We use more than one dataset in many of the reports and we always think to join or merge datasets to provide a good solution in reports but we were not able to do it in 2005 or 2008, but now the time has come and microsoft has finally included some cool functions (Lookup, LookupSet, MultiLookup) in SSRS 2008 R2
In Lookup function, you need to pass following things:
Let's see how "LOOKUP" works here, Suppose we have a two datasets in the report, ex. one dataset (Store) has store information (StoreID, StoreName, Location, $ Sales etc, Date) and second dataset (Sales) has sales information. (StoreID, Date, Target $ Sales etc.)
I will directly grab a columns from first dataset but I also want to display target sales amount as a new column with this information. Now you can use Lookup function here in a new column
In Lookup function, you need to pass following things:
- Value form the first dataset to join with second dataset (ex. StoreID from dataset1)
- Value from the second dataset and it look to be the same (ex. StoreID from dataset2)
- The value that you want to display in reports from the second dataset (ex. TargetSales)
- Name of the second dataset (ex. “Sales”)
- Hardik
Comments
Post a Comment