简体   繁体   中英

SSRS Assign a Value in dataset 2 based on a value in dataset1

I have an SSRS report with 2 datasets. dataset1 has a value called Party_Number and dataset2 has a value called Name .

I am pulling the name from a Lookup:

Lookup(Fields!MODIFIED_IPP.Value,Fields!IPP.Value,Fields!Trustee_Name.Value,"DataSet2")

However I want to hard code 2 values because the IPPs do not exist in dataset1.

For example I would like to say IIF the IPP in dataset1 equals 111 then use the name "Jane Doe" for Trustee_Name else use the above Lookup expression.

Is this possible?

Try the following expression, it has multiple iif with lookups. The first two iif are hard coded to the values of 111 and 222 , then a lookup and a blank default entry if nothing is detected.

Hope this helps some...

=IIF(Fields!MODIFIED_IPP.Value = "111", "Jane Doe",IIF(Fields!MODIFIED_IPP.Value = "222", "John Dex",
 IIF(len(Lookup(Fields!MODIFIED_IPP.Value, Fields!IPP.Value,  Fields!Trustee_Name.Value, "DataSet2")) > 0 , 
 Lookup(Fields!MODIFIED_IPP.Value, Fields!IPP.Value,  Fields!Trustee_Name.Value, "DataSet2") , "Blank default entry")))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM