|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
本帖最后由 icezs 于 2018-9-25 11:46 编辑
无响应查询如下(在excel里修改datez的值是能返回结果,只是刷新出现无响应):
DEFINE
var datez=DATEVALUE("2018.9.1")
EVALUATE
UNION(
summarize(FILTER(CXGZ,[日期]>=datez),[日期],[产品名称],"计划", sum(CXGZ[计划]),"投入", sum(CXGZ[合格])+sum(CXGZ[不合格]),"合格",sum(CXGZ[合格]),"不合格", sum(CXGZ[不合格]),"工序","成型"),
summarize(FILTER(QG,[日期]>=datez), [日期],[产品名称],"计划", sum(QG[计划]), "投入", sum(QG[投入]), "合格",sum(QG[合格]), "不合格", sum(QG[不合格]) ,"工序","切割"),
summarize(FILTER(SC,[日期]>=datez), [日期],[产品名称],"计划", sum(SC[计划]), "投入", sum(SC[投入]), "合格",sum(SC[合格]), "不合格", sum(SC[不合格]) ,"工序","烧成"),
summarize(FILTER(MB,[日期]>=datez), [日期],[产品名称],"计划", sum(MB[计划]), "投入", sum(MB[投入]), "合格",sum(MB[合格]), "不合格", sum(MB[不合格]) ,"工序","磨边"),
summarize(FILTER(ZP,[日期]>=datez), [日期],[产品名称],"计划", sum(zp[计划]), "投入", sum(ZP[投入]), "合格",sum(ZP[合格]), "不合格", sum(ZP[不合格]) ,"工序","造皮"),
summarize(FILTER(JC,[日期]>=datez), [日期],[产品名称],"计划", sum(JC[计划]), "投入", sum(JC[投入]), "合格",sum(JC[合格]), "不合格", sum(JC[不合格]) ,"工序","检查")
)
ORDER BY [日期],[工序],[产品名称]
去掉var就没问题了。。。
EVALUATE
UNION(
summarize(FILTER(CXGZ,[日期]>=TODAY()-13),[日期],[产品名称],"计划", sum(CXGZ[计划]),"投入", sum(CXGZ[合格])+sum(CXGZ[不合格]),"合格",sum(CXGZ[合格]),"不合格", sum(CXGZ[不合格]),"工序","成型"),
summarize(FILTER(QG,[日期]>=TODAY()-13), [日期],[产品名称],"计划", sum(QG[计划]), "投入", sum(QG[投入]), "合格",sum(QG[合格]), "不合格", sum(QG[不合格]) ,"工序","切割"),
summarize(FILTER(SC,[日期]>=TODAY()-13), [日期],[产品名称],"计划", sum(SC[计划]), "投入", sum(SC[投入]), "合格",sum(SC[合格]), "不合格", sum(SC[不合格]) ,"工序","烧成"),
summarize(FILTER(MB,[日期]>=TODAY()-13), [日期],[产品名称],"计划", sum(MB[计划]), "投入", sum(MB[投入]), "合格",sum(MB[合格]), "不合格", sum(MB[不合格]) ,"工序","磨边"),
summarize(FILTER(ZP,[日期]>=TODAY()-13), [日期],[产品名称],"计划", sum(zp[计划]), "投入", sum(ZP[投入]), "合格",sum(ZP[合格]), "不合格", sum(ZP[不合格]) ,"工序","造皮"),
summarize(FILTER(JC,[日期]>=TODAY()-13), [日期],[产品名称],"计划", sum(JC[计划]), "投入", sum(JC[投入]), "合格",sum(JC[合格]), "不合格", sum(JC[不合格]) ,"工序","检查")
)
ORDER BY [日期],[工序],[产品名称]
|
|