Reputation: 67
I have two datasets.
One dataset1
has the fields MonthNumber
, MonthData
.
The other dataset2
has the fields MonthNumber
, MonthBase
.
I want to use both the MonthData
field and MonthBase
fields in one dataset to create a chart.
Please help me if anyone has an idea how I can combine both datasets to one or use one field of one dataset into another?
Upvotes: 1
Views: 1747
Reputation: 3038
To combine the fields from two datasets without combining the datasets you need to use the LOOKUP function.
To replicate this I created the datasets...
DataSet1
--------
MonthNumber MonthData
------------ ----------
1 12
2 23
3 11
4 8
DataSet 2
---------
MonthNumber MonthData
------------ ----------
1 10
2 15
3 20
4 25
Create a chart as you would normally for DataSet1.
Set the values to MonthData, and the Category Groups to MonthNumber Then add a new Series in the Values area, and set the expression to
=Lookup(Fields!MonthNumber.Value, Fields!MonthNumber.Value,
Fields!MonthBase.Value, "DataSet2")
This effectively states join The ID fields DataSet1.MonthNumber, to DataSet2.MonthNumber, returning me DataSet2.MonthBase
The design will look like this
And the output like this
See also the reference here from which I derived this answer
Upvotes: 2