C.C
C.C

Reputation: 179

SSRS Lookup Based on Multiple Conditions

I have a dataset (Volume) looks like this:

enter image description here

In my report, what I want to get is this:

enter image description here

The Lookup expression: =Lookup (Fields!Id.Value, Fields!Id.Value, Fields!Volume.Value,"Volume") can only lookup on ID. Is there any way I can do lookup on ID first, and then lookup on Sub_Group to get the correct Volume? Thank you.

Upvotes: 14

Views: 35934

Answers (1)

Pete Rennard-Cumming
Pete Rennard-Cumming

Reputation: 1618

You can Lookup using multiple fields if you concatenate all the necessary fields in the first and second Lookup parameter.

=Lookup(Fields!ID.Value & Fields!SUB_GROUP.Value, Fields!ID.Value & Fields!SUB_GROUP.Value, Fields!VOLUME.Value, "Volume")

Alternatively, you can concatenate all the necessary fields in your dataset and use that for your Lookup.

Upvotes: 29

Related Questions