Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use the Lookup expression and the IIF expression in SSRS?

I have researched and not been able to find the answer to my question. My goal is to use the Lookup function in SSRS, which is currently performing as intended. However, I have null values that are not present which I would represented as '0'. It seems like I should be able to use the Lookup expression along with a IIF function. However, I cannot find an example of this. Any ideas how I can accomplish this? My Lookup expression is below.

=LookUp(Fields!SKU.Value,
Fields!ItemCode.Value, 
Fields!Store.Value, "DataSet3")
like image 962
Thomas Avatar asked Oct 19 '25 06:10

Thomas


1 Answers

I'd use IsNothing function to check if the value is Null and wrap it in a IIF expression. Here is the Microsoft reference for different expressions.

=IIF
(
  IsNothing(LookUp(Fields!SKU.Value, Fields!ItemCode.Value, Fields!Store.Value, "DataSet3"))
, 0
, LookUp(Fields!SKU.Value, Fields!ItemCode.Value, Fields!Store.Value, "DataSet3")
)
like image 81
aduguid Avatar answered Oct 22 '25 04:10

aduguid