我在报告中有三个饼图,每个饼图都与联合查询绑定。这三个查询的设置都相同,唯一的区别是它们引用的列。这些列均包含“高”,“中”或“低”。一张图表可以正常工作,一个图表不能正确显示百分比,另一个图表不能正确显示颜色。
与正常工作的图表相关的查询:
SELECT tScenarios.riskRating,IIf([riskRating]="Low",1,
IIf([riskRating]="Medium",2,IIf([riskRating]="High",3))) AS Expr1,
IIf([Expr1]=1,"Low",IIf([Expr1]=2,"Medium",IIf([Expr1]=3,"High"))) AS Expr2,
"D" AS Source FROM tScenarios
UNION SELECT "Low", 1, "Low", "X" FROM tScenarios
UNION SELECT "Medium", 2, "Medium", "X" FROM tScenarios
UNION SELECT "High", 3, "High", "X" FROM tScenarios;
运行正常的图表行来源:
SELECT qOverallRisk.[riskRating], Count(qOverallRisk.[Expr2]) - 1 AS CountOfExpr2
FROM qOverallRisk GROUP BY qOverallRisk.[riskRating]
HAVING (((qOverallRisk.[riskRating])<>""));
未正确显示百分比的图表将“高”,“中”和“低”分别设置为大约33%,而它应分别以25%和“高”显示“中”和“低” “为50% 查询:
SELECT tScenarios.residualRisk, IIf([residualRisk]="Low",1,IIf([residualRisk]="Medium",2,
IIf([residualRisk]="High",3))) AS Expr1,
IIf([Expr1]=1,"Low",IIf([Expr1]=2,"Medium",IIf([Expr1]=3,"High"))) AS Expr2, "D" AS Source
FROM tScenarios
UNION SELECT "Low", 1, "Low", "X" FROM tScenarios
UNION SELECT "Medium", 2, "Medium", "X" FROM tScenarios
UNION SELECT "High", 3, "High", "X" FROM tScenarios;
行来源:
SELECT qOverallResidual.[residualRisk], Count(qOverallResidual.[Expr2]) AS CountOfExpr2
FROM qOverallResidual GROUP BY qOverallResidual.[residualRisk]
HAVING (((qOverallResidual.[residualRisk])<>""));
未正确显示颜色的图表将在不存在“低”的情况下将“中”设置为绿色。 “高”应该是红色,“中”应该是黄色,“低”应该是绿色。我以前在另一个图表上遇到过此问题,并使用这些查询对其进行了修复,但是在对此图表进行相同的更改后,颜色问题仍然存在。
查询:
SELECT tScenarios.ncmRisk, IIf([ncmRisk]="Low",1,IIf([ncmRisk]="Medium",2,
IIf([ncmRisk]="High",3))) AS Expr1,
IIf([Expr1]=1,"Low",IIf([Expr1]=2,"Medium",IIf([Expr1]=3,"High"))) AS Expr2,
"D" AS Source
FROM tScenarios
UNION SELECT "Low", 1, "Low", "X" FROM tScenarios
UNION SELECT "Medium", 2, "Medium", "X" FROM tScenarios
UNION SELECT "High", 3, "High", "X" FROM tScenarios;
行来源:
SELECT qNcmRisk.[ncmRisk], Count(qNcmRisk.[Expr2]) - 1 AS CountOfExpr2
FROM qNcmRisk GROUP BY qNcmRisk.[ncmRisk]
HAVING (((qNcmRisk.[ncmRisk])<>""));
对我来说,这实际上没有任何意义,因为考虑到这三者实际上是相同的,唯一的不同是所引用的专栏,但其中一部著作与另外两部著作完全不同。
我们非常感谢您的帮助,我可以提供其他可能需要的信息。提前致谢!