1金币
本帖最后由 CAIT 于 2024-9-23 16:22 编辑
{IIF(Weekday(默认日期, 2) >= 1 And Weekday(默认日期, 2) <= 5 And Not IsNothing(请假时长) And IsNothing(工时合计), "LightGreen",
IIF(Weekday(默认日期, 2) >= 1 And Weekday(默认日期, 2) <= 5 And IsNothing(请假时长) And Not IsNothing(工时合计), "LightGreen",
IIF(Weekday(默认日期, 2) = 6 And Not IsNothing(加班时长) And Not IsNothing(工时合计), "LightGreen",
IIF(Weekday(默认日期, 2) = 6 And IsNothing(加班时长) And IsNothing(工时合计), "LightGreen",
IIF(Weekday(默认日期, 2) = 7 And Not IsNothing(加班时长) And Not IsNothing(工时合计), "LightGreen",
IIF(Weekday(默认日期, 2) = 7 And IsNothing(加班时长) And IsNothing(工时合计), "LightGreen",
"yellow"))))))}
按照条件,加班时长和公式合计都为空的时候,应该也显示绿色才对,这两条加粗的公式没有生效,还是会显示黄色,是有什么问题吗?
|
最佳答案
查看完整内容
大佬,IIF条件嵌套用的有点多,报表表达式是支持Switch判断的哦,可以考虑用【Switch】来做:
条件中有很多重复的逻辑,可以通过将相同部分提取出来简化:
将工作日(周一到周五)和周末(周六和周日)的处理逻辑进行归类
工作日逻辑(周一到周五):当 Weekday(默认日期, 2) 在 1 到 5 之间时,只需要判断是否有请假时长或者工时合计。
周末逻辑(周六、周日):对于周六和周日,同样的逻辑可应用于加班时长和工时合计,合并 ...
|