求助导出并自动纵横统计
遇到个复杂统计,但只会一句一句条件的统计,不能自动,太低效了,请高手帮忙实现自动提取数据并统计,实现效果如下图
2023信息.zip
(4.82 KB)
[此贴子已经被作者于2023-8-9 11:55编辑过]
[此贴子已经被作者于2023-8-9 11:55编辑过]
USE 2023信息 ALIAS b2023 SELECT DISTINCT bmddm FROM b2023 INTO ARRAY arr_bmddm SELECT DISTINCT xkkmzhdm FROM b2023 ORDER BY xkkmzhdm INTO ARRAY arr_xkkmzhdm cmd = "CREATE CURSOR tt (xkkmzhdm c(8),zong I" FOR i=1 TO ALEN(arr_bmddm) cmd = cmd + "," + "_" + arr_bmddm[i] + " I" ENDFOR cmd = cmd + ")" EXECSCRIPT(cmd) APPEND FROM ARRAY arr_xkkmzhdm INDEX on xkkmzhdm TAG xkkmzhdm SELECT b2023 SET RELATION TO xkkmzhdm INTO "tt" SCAN REPLACE tt.zong WITH tt.zong + 1, ("tt._"+b2023.bmddm) WITH EVALUATE("tt._"+b2023.bmddm) + 1 ENDSCAN SELECT * FROM tt
[此贴子已经被作者于2023-8-9 21:09编辑过]