September 12, 2012 at 2:36 pm
I have 2 datasets from the same database in ssrs 2008 and I need fields from both datasets in one table. I achieved adding the fields from both datasets without a problem by using lookup. However now I need to get a count and a percentage of the results in my table. Any help would be appreciated!
Example:
Dataset1 (grouped by practice) Dataset2
112233 112233
258369
369147 369147
159357 159357
Total for Dataset1 4
Total for Dataset2 3
Percentage% 75%
September 12, 2012 at 2:42 pm
lareciadbell (9/12/2012)
I have 2 datasets from the same database in ssrs 2008 and I need fields from both datasets in one table. I achieved adding the fields from both datasets without a problem by using lookup. However now I need to get a count and a percentage of the results in my table. Any help would be appreciated!Example:
Dataset1 (grouped by practice) Dataset2
112233 112233
258369
369147 369147
159357 159357
Total for Dataset1 4
Total for Dataset2 3
Percentage% 75%
Your question is extremely vague but are you looking for Count()??? http://msdn.microsoft.com/en-us/library/ms157163%28v=sql.100%29.aspx
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
September 12, 2012 at 3:03 pm
Yes I am looking for a count in each dataset. So in dataset1 I would expect 4 and in dataset2 I would expect 3.
September 12, 2012 at 3:07 pm
lareciadbell (9/12/2012)
Yes I am looking for a count in each dataset. So in dataset1 I would expect 4 and in dataset2 I would expect 3.
Take a look at the link I sent. It explains how the count function works. There is a link on that page that goes into great detail about how to use the built in functions in expressions (which I think is what you are ultimately looking for).
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
September 12, 2012 at 5:39 pm
If you are looking to add counts from different datasets in a single expression:
In the expression editor select Datasets in the Category box, select the dataset in the Item box, then doubleclick the value you want. By default it will drop into the expression editor with a sum() or first() aggregate depending on the datatype (not limited to these, just common examples). Just type over sum or first or whatever with count().
like:
=Count(Fields!FieldName1.Value, "Dataset1") + Count(Fields!FieldName2.Value, "Dataset2")
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply