我想为每个不同的record_id评估多个条件
我的表中有20多个列,每个record_id都根据视图中的case语句为ex打分是/否:
record_id,is_up,is_down,is_left,is_right
1234年--不--是的
我开始使用if / then / else语句,如下所示:
if is_up = yes then "Its Up" else
if is_down = yes then "Its Down else
if is_left = yes then "Its Left else
if is_right = yes then "Its Right" else "Not" 此操作直到记录满足多个条件为止,然后报表仅在满足第一个条件时显示记录。
我希望对这个公式进行分组,并显示满足每个条件的所有记录,因此,如果record_id 3344在每个条件中都有“是”,那么它将显示在每个组下面。
理想情况下,我希望避免对每一种情况都有多个子报告。
欢迎您提出任何建议或想法,谢谢!
发布于 2017-05-23 18:52:38
如果要对要转换的20列调用条件/函数20次,则使用sql命令数据源,而不是基于表的。
你需要以下几点:
样本代码
Select
translate(col1) t1,
translate(col2) t2
translate(col3) t3,
translate(col4) t4,
....t20
From table或
Select iif(col1='condition',truevale,falsevalue) t1,.....t20 from table或案件
https://stackoverflow.com/questions/44074663
复制相似问题