TSG954
asked on
ssrs parameter on dataset from tablix row
Novice in SSRS using SQL Server 2008, BIDS.
I'd like to know how I can Query a second dataset based on the value of a row in a tablix, so that I may then turn around and display the value from returning query on another column in the same tablix.
Any point of direction would be appreciated.
Thanks
I'd like to know how I can Query a second dataset based on the value of a row in a tablix, so that I may then turn around and display the value from returning query on another column in the same tablix.
Any point of direction would be appreciated.
Thanks
ASKER
Thanks, what would be the syntax for #1. the value of column resultA.
When you create the paramenter, you should be able to set the value as non-queried or From Query. You should select From Query and the value from QueryA.
http://www.sql-server-performance.com/articles/reporting/report_parameters_p1.aspx
has a good example.
http://www.sql-server-performance.com/articles/reporting/report_parameters_p1.aspx
has a good example.
ASKER
Thanks, I'm now receiveing the data JobOrderID in the parameter, i'd like to take it a step further and use dataset2 field Placement and add into the tablix. Is this possible?
I would recommend merging the two datasets into one (if the data is coming from the same database), but if it's not possible for you to do that, then...
You should beable to create another parameterB (set it as Multivalue and set it's value to dataset2.Placement) . Then add the parameter to your tablix.
You should beable to create another parameterB (set it as Multivalue and set it's value to dataset2.Placement) . Then add the parameter to your tablix.
ASKER
Cant do the first suggestion,
Tried the second suggestion however, it says only fields from the current dataset can be added.
Tried the second suggestion however, it says only fields from the current dataset can be added.
You may need to create a third dataset (DatasetC) that is exactly the same as DataSetA, but has ParameterB included in the select stmt.
ie. SELECT col1, col2,.., Parameters!ParameterB.Valu e AS col3....
Then bind datasetC to the tablix
You can do this by:
In data set properties of datasetC, click on parameters tab and use JOIN() funtion as:
=JOIN(Parameters!Parameter B.Value, “,”)
You should be able to add ParameterB in the fields list.
ie. SELECT col1, col2,.., Parameters!ParameterB.Valu
Then bind datasetC to the tablix
You can do this by:
In data set properties of datasetC, click on parameters tab and use JOIN() funtion as:
=JOIN(Parameters!Parameter
You should be able to add ParameterB in the fields list.
or you can try using a subreport
ASKER
Unfortunately, it doesnt seem to like the Parameters!ParameterB.Valu e in the select stmt.
Says incorrect syntax near '!'.
Says incorrect syntax near '!'.
ASKER
Subreport may be the way to go. Any examples out there?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
2.Create a second dataset B. Add ParameterA as a parameter to QueryB, called @parameterA.
3.In your query, use the parameter like this:
SELECT col1, col2 WHERE valueColumn IN (@parameterA)
http://www.sql-server-performance.com/articles/reporting/report_parameters_p1.aspx
http://msdn.microsoft.com/en-us/library/ms155917(v=SQL.100).aspx
http://msdn.microsoft.com/en-us/library/aa337292.aspx