SSRS nested iif expression in lookup

筅森魡賤 提交于 2019-12-23 02:45:18

问题


I'm brand new to SSRS and could use some help: is it possible to nest a lookup expression inside an iif statement? I have a web form with checkboxes and would like to change the answer text from "True" and "False" to "Agree" and "Disagree", but because I'm using a lookup expression to get the responses, I can't use a simple iif statement. When I try to use two Expressions, I get an error message. Here are my expressions:

=iif(ReportItems!Textbox70.Value = true, "Agree", "Do not agree")
=Lookup(22, Fields!QuestionID.Value, Fields!ResponseDisplayText.Value, "ApplicationData")

回答1:


Yes it is possible to nest a lookup expression inside an iif statement.

Your code should look like the following:

=iif(Lookup(22, Fields!QuestionID.Value, Fields!ResponseDisplayText.Value, "ApplicationData"), "Agree", "Do not agree")

Also just for future reference, remember that when using scopes inside nested logic (such as "ApplicationData") you may run into some problems with SSRS if the innermost scope values are larger than/ different than the scope of the outermost values.

Hope that helps!



来源:https://stackoverflow.com/questions/21993846/ssrs-nested-iif-expression-in-lookup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!