表达式中错位的括号
Misplaced parenthesis in expression
再有一双眼睛来看这个就好了。我越弄乱它,就会收到两条错误消息之一。它要么需要另一个括号,要么不正确使用 True/False。我只是看着它有点沮丧。任何帮助将非常感激。这是漫长的一天。
=IIF((Sum(Fields!January.Value, "CDataSet")- Code.DivideBy(Fields!M191.Value, Sum(Fields!Totals.Value, "DataSet2")) < 0
and (Sum(Fields!January.Value, "CDataSet")- Code.DivideBy(Fields!M191.Value, Sum(Fields!Totals.Value, "DataSet2")))> Sum(Fields!Variance.Value, "CDataSet")),"Red",
IIF((Sum(Fields!January.Value,"CDataSet")- Code.DivideBy(Fields!M191.Value, Sum(Fields!Totals.Value, "DataSet2"))) > 0
and (Sum(Fields!January.Value, "CDataSet")- Code.DivideBy(Fields!M191.Value, Sum(Fields!Totals.Value, "DataSet2"))) > Sum(Fields!Variance.Value, "CDataSet")), "LimeGreen","Transparent")
当我将代码缩进到括号级别时,我得到:
=IIF(
(
Sum(Fields!January.Value, "CDataSet") - Code.DivideBy(
Fields!M191.Value, Sum(Fields!Totals.Value, "DataSet2")
) < 0
and (
Sum(Fields!January.Value, "CDataSet") - Code.DivideBy(
Fields!M191.Value, Sum(Fields!Totals.Value, "DataSet2")
)
) > Sum(Fields!ThresholdAging.Value, "CDataSet")
),
"Red",
IIF(
(
Sum(Fields!January.Value,"CDataSet") - Code.DivideBy(
Fields!M191.Value, Sum(Fields!Totals.Value, "DataSet2")
)
) > 0
and (
Sum(Fields!January.Value, "CDataSet") - Code.DivideBy(
Fields!M191.Value, Sum(Fields!Totals.Value, "DataSet2")
)
) > Sum(Fields!ThresholdAging.Value, "CDataSet")
),
"LimeGreen",
"Transparent"
)
结论:内层IIF只有一个参数,外层IIF有五个。我认为您的意思是将最后两个字符串放在内部 IIF 中:
...
) > Sum(Fields!ThresholdAging.Value, "CDataSet"),
"LimeGreen",
"Transparent"
)
)
再有一双眼睛来看这个就好了。我越弄乱它,就会收到两条错误消息之一。它要么需要另一个括号,要么不正确使用 True/False。我只是看着它有点沮丧。任何帮助将非常感激。这是漫长的一天。
=IIF((Sum(Fields!January.Value, "CDataSet")- Code.DivideBy(Fields!M191.Value, Sum(Fields!Totals.Value, "DataSet2")) < 0
and (Sum(Fields!January.Value, "CDataSet")- Code.DivideBy(Fields!M191.Value, Sum(Fields!Totals.Value, "DataSet2")))> Sum(Fields!Variance.Value, "CDataSet")),"Red",
IIF((Sum(Fields!January.Value,"CDataSet")- Code.DivideBy(Fields!M191.Value, Sum(Fields!Totals.Value, "DataSet2"))) > 0
and (Sum(Fields!January.Value, "CDataSet")- Code.DivideBy(Fields!M191.Value, Sum(Fields!Totals.Value, "DataSet2"))) > Sum(Fields!Variance.Value, "CDataSet")), "LimeGreen","Transparent")
当我将代码缩进到括号级别时,我得到:
=IIF(
(
Sum(Fields!January.Value, "CDataSet") - Code.DivideBy(
Fields!M191.Value, Sum(Fields!Totals.Value, "DataSet2")
) < 0
and (
Sum(Fields!January.Value, "CDataSet") - Code.DivideBy(
Fields!M191.Value, Sum(Fields!Totals.Value, "DataSet2")
)
) > Sum(Fields!ThresholdAging.Value, "CDataSet")
),
"Red",
IIF(
(
Sum(Fields!January.Value,"CDataSet") - Code.DivideBy(
Fields!M191.Value, Sum(Fields!Totals.Value, "DataSet2")
)
) > 0
and (
Sum(Fields!January.Value, "CDataSet") - Code.DivideBy(
Fields!M191.Value, Sum(Fields!Totals.Value, "DataSet2")
)
) > Sum(Fields!ThresholdAging.Value, "CDataSet")
),
"LimeGreen",
"Transparent"
)
结论:内层IIF只有一个参数,外层IIF有五个。我认为您的意思是将最后两个字符串放在内部 IIF 中:
...
) > Sum(Fields!ThresholdAging.Value, "CDataSet"),
"LimeGreen",
"Transparent"
)
)