So I am using Report Builder in order to create a dashboard connecting the information between 2 lists in Sharepoint and fetching specific cases. Practically speaking, the cases in one lists are sales and the cases on the other list are tracking items (documents) for each sale. They are connected with a common ID (ID on the first list, SaleID on the tracking list) and there can be a relationship of one sale to many tracking items (at least one to one). There will be various tables on the dashboard but the concept is the same for all (meaning data misalignment).
Since the relationship is one to many, I want to compare the document status on the sales list with the document status on the last tracking item on the tracking list and then filter out all the cases that the tracking status is the same on the 2 lists.
Using the lookupset, I encounter the #Error when the array is empty.
I tried different variations like:
=iif(
(LookupSet(Fields!ID.Value, Cint(Fields!Sale_ID.Value), Fields!document_status.Value, "sales").length) >= 1
,((LookupSet(Fields!ID.Value, Cint(Fields!Sale_ID.Value), Fields!document_status.Value, "tracking"))((LookupSet(Fields!ID.Value, Cint(Fields!Sale_ID.Value), Fields!document_status.Value, "tracking")).Length - 1))
,"")
or
=IIF(
IsNothing(Lookup(Fields!ID.Value, Cint(Fields!Sale_ID.Value), Fields!document_status.Value, "tracking")),
"",
((LookupSet(Fields!ID.Value, Cint(Fields!Sale_ID.Value), Fields!document_status.Value, "tracking"))
((LookupSet(Fields!ID.Value, Cint(Fields!Sale_ID.Value), Fields!document_status.Value, "tracking")).Length - 1))
)
There are other variations of the above too, but no matter how many things I tried, I still get the same error when the array is empty, but I want to just display blank cell in that case. Any help would be appreciated! Thanks in advance!