Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Pass Parameter for two different Datasets


Pass Parameter for two different Datasets

Author
Message
sharonsql2013
sharonsql2013
SSC-Addicted
SSC-Addicted (406 reputation)SSC-Addicted (406 reputation)SSC-Addicted (406 reputation)SSC-Addicted (406 reputation)SSC-Addicted (406 reputation)SSC-Addicted (406 reputation)SSC-Addicted (406 reputation)SSC-Addicted (406 reputation)

Group: General Forum Members
Points: 406 Visits: 1220
I have two seperate datasets :
Dataset1 and Dataset 2 and want to display results from both of them for the same values.
Here is what I have done :

Created Dataset3 and written a query where I pass the parameters to get two combo boxes on the report to fetch values.
On dataset 1 , I added Filter with the expression :
=First(Fields!ProdNbr.Value, "Dataset3")

But it gives me an error : Aggregate functions cannot be used in dataset filters .
Any ideas???
Mark Fitzgerald-331224
Mark Fitzgerald-331224
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3692 Visits: 1513
If you want to produce a join like structure between the two datasets then either:

- create a join within a single dataset if the sources are compatible (i.e. both from same SQL server etc)
- use one of the SSRS lookup expressions to access the columns returned from dataset2 for the equivalent ProdNbr is dataset1.

Example:

DataSet1 : ProductNbr, Name, Color, ListPrice
DataSet2 : ProductNbr, QuantitySold, SalesAmount

1. Create a table and add the columns from DataSet1
2. Add a additional column to the table and add the expression as shown below. The function is used as :

= LOOKUP( FieldInCurrentDataSet, FieldInTargetDataSet, FieldToReturnFromTargetDataSet, "NameOfTargetDataSet")

= LOOKUP( Fields!ProdNbr.Value, Fields!ProdNbr.Value, Fields!QuantitySold.Value, "DataSet2")

3. If you want to return multiple values evaluate the use of LOOKUPSET and MULTILOOKUP as well.

If this is not what you were looking for the please reply with more details and I will try to help.

Fitz
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search