SSRS表达式替换为NA的NA(SSRS Expression to Substitute 0 for NA)

编程入门 行业动态 更新时间:2024-10-25 08:16:41
SSRS表达式替换为NA的NA(SSRS Expression to Substitute 0 for NA)

我有下面提供的SSRS表达式。 该表达式的问题是最后一列有时会显示#VALUE! 当第一列值为NA 。 它基本上没有计算。 如何修复此表达式以使其显示正确的数值? 一种可能的解决方案是用0代替NA ,但我怎样才能做到这一点?

表达:

= iif(Fields!NumType.Value =“1”,iif(reportItems!txt_Current_Filing_Firm.value =“”,“0”,reportItems!txt_Current_Filing_Firm.value),“1”) - IIF(Fields!NumType.Value =“1 “,iif(reportitems!txt_Compare_Filing_Firm.value =”“,”0“,reportitems!txt_Compare_Filing_Firm.value),”1“)

SSRS的当前产出:

Column 1 | Column 2 | Column 3 NA 3456.00 #VALUE! NA 347856.00 #VALUE! NA 98763456.00 #VALUE! NA 33456.35 #VALUE!

SSRS的预期产出:

Column 1 | Column 2 | Column 3 0 3456.00 -3456.00 0 347856.00 -347856.00 0 98763456.00 -98763456.00 0 33456.35 -33456.35

I've the SSRS Expression that is provided below. The issue with that expression is that the last column sometimes shows #VALUE! when the 1st column value is NA. It is basically failing to calculate. How can I fix this expression so that it shows the correct numeric value? One possible solution is to substitute 0 for NA, but how can I achieve this ?

Expression:

=iif(Fields!NumType.Value = "1",iif(reportItems!txt_Current_Filing_Firm.value = "","0",reportItems!txt_Current_Filing_Firm.value),"1") - IIF(Fields!NumType.Value = "1",iif(reportitems!txt_Compare_Filing_Firm.value = "","0",reportitems!txt_Compare_Filing_Firm.value),"1")

Current Output in SSRS:

Column 1 | Column 2 | Column 3 NA 3456.00 #VALUE! NA 347856.00 #VALUE! NA 98763456.00 #VALUE! NA 33456.35 #VALUE!

Expected Output in SSRS:

Column 1 | Column 2 | Column 3 0 3456.00 -3456.00 0 347856.00 -347856.00 0 98763456.00 -98763456.00 0 33456.35 -33456.35

最满意答案

这是解决方案。 想分享。 我们需要用0代替“NA”。它有效!

= iif(Fields!NumType.Value =“1”,iif(reportItems!txt_Current_Filing_Firm.value =“”OR reportItems!txt_Current_Filing_Firm.value =“NA”,“0”,reportItems!txt_Current_Filing_Firm.value),“1”) - IIF(Fields!NumType.Value =“1”,iif(reportItems!txt_Current_Filing_Firm.value =“”或reportitems!txt_Compare_Filing_Firm.value =“NA”,“0”,reportitems!txt_Compare_Filing_Firm.value),“1”)

Here is the solution. Thought to share. We need to replace "NA" with 0. It works!

=iif(Fields!NumType.Value = "1",iif(reportItems!txt_Current_Filing_Firm.value = "" OR reportItems!txt_Current_Filing_Firm.value = "NA","0",reportItems!txt_Current_Filing_Firm.value),"1") - IIF(Fields!NumType.Value = "1",iif(reportItems!txt_Current_Filing_Firm.value = "" OR reportitems!txt_Compare_Filing_Firm.value = "NA","0",reportitems!txt_Compare_Filing_Firm.value),"1")

更多推荐

本文发布于:2023-07-21 09:34:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1208995.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表达式   SSRS   NA   Substitute   Expression

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!