SSRS IIF expression for Counting Division - reporting-services

Hi I am trying to write an expression of COunt Division based on price as shown in figure http://i43.tinypic.com/2r47hqx.png
I am doing group column on Division but how can I get exact no. of count in Count Division Column those having price in their division.
Can anybody suggest any 'expression' that I can use in that Count Division Coulmn.
Please help!!!

As you say you have a column called Division that you are grouping on, add a summary column, i.e. outside of the column group, and set the textbox expression to:
=CountDistinct(Fields!Division.Value)
This will be applied in the row scope only so will effectively be a count of all non-null divisions in that row.

Related

Group totals in tablix - only returning first value

I have a tablix that is grouped (row group) according to variety name, and year planted.
Itemized, each plot has an area, and without grouping, this is showing up correctly in the report. With grouping, per variety name and year planted, it only returns the first value, rather than the total of all values within the groups.
I've tried Fields!NewArea.Value, and SUM(Fields!NewArea.Value) - it still returns on the first record's area, rather than the sum areas.
Can someone tell me how to achieve the sum, per group?
If you right-click on your rowgroup in the grouping pane below the main design window, then choose Add Total Before/After. It should create sums in the new total row automatically, but if not then the expression just needs to be
=SUM(Fields!myFieldName.Value)
The SUM() is evaluated at the row context level, so in your case it will be the sum of the values in the same row group.

Adding Totals for each column in table/Matrix with two row groups and a column group

I have a table/matrix with 3 groups, 1 column group and 2 rows groups.
I need to add a row at the bottom that will display totals on each column. I have tried working with the "right-click > Add Total" thingy but it only adds the static column "Total" but the grouped columns are blank; there's no expression.
How can I achieve this?
Your current design appears to have no numeric data to summarise, so when you add a total row, SSRS does not know what or how you want your aggregation to work.
You can manually add expressions to the textboxes total line, so if you wanted a count of results you could use something like.
=COUNT(Fields!AnswerText.Value)
If this does not help, explain what you want to see on your total row and how you would calculate it.

SSRS adding a percentage column based on a specifc column category in a matrix/tablix

I have a matrix/tablix set up so there are 4 row groups going down the left-hand side and a column group called RegCompCategory:
When the report is run, the RegCompCategory column group produces 3 distinct columns based on the categories in the underlying data:
What I'd like to do is add another column before the RegCompCategory column group that will display a percentage of the "fully-marked" column against the "total" column:
I'm guessing I will need to write an expression for the fields highlighted above, but I'm not sure how to reference the RegCompCategory to identify specifically the "Fully-Marked" category of data.
Could someone give me a few pointers? Many thanks.
Try:
=Count(IIF(Fields!RegCompCategory.Value="Fully-Market",Fields!RegCompCategory.Value,Nothing))
/
Count(Fields!RegCompCategory.Value)
It will count the number of Fully-Market rows and divide by the total rows. I think that is what you are expecting.
Let me know if this helps you.

IIF expression for Count for division

I am trying to write an expression of Count Division based on price as shown in figure
I am doing group column on Division but how can I get exact no. of count in Count Division Column those having price in their division.
I wrote this expression for Count Division column =count(fields!Price.Value) but it's not working.
Can anybody help me?

Error in finding sum of a group and Conditional Summing in SSRS Reports

I have an SSRS Report, in the database there is a column by name Total_running_hours.
There are more than one record for a single Cycle_number like more than 1 row with same Cycle_number but different Block_numbers and the value in Total_running_hours field will be same for all the rows with same Cycle_number. Eg. 1 Cycle number with 4 diff block_numbers contain same Total_running_hours for all 4 rows.
Now the problem is, in the group footer if I put this field then it will show the Total_running_hours value only once which is correct, but my final requirement is,
I need to get the sum of this field in the Report footer which need to display the sum group wise. No matter how many rows are there for a single Cycle_number it has to take only once and display the result.
I tried in different ways like
=sum(ReportItems!textbox204.Value) // name of text box in Group footer
Error: Report item expressions can only refer to other report items
within the same grouping scope or a containing grouping scope.
=sum(Fields!total_running_hours.Value,Group_name)
Error: The scope parameter must be set to a string constant that is
equal to either the name of a containing group, the name of a
containing data region, or the name of a data set.
Can any one please help me in getting the sum Group wise
Thank you in advance.
I found solution for this Problem.
We cannot simply sum the Total_Running_hours value as this would give us duplicates and the incorrect answer. We cannot sum the reporting services group as it goes out of scope
There is no SUM DISTINCT available in Reporting Services 2005 so we can't get the distinct value that way.
Since the query may not return a particular Cycle_Number Type we cannot use that as a filter.
The solution found was to add a column of the row number within a windowed set partitioned by the Cycle_Number like this
ROW_NUMBER() OVER (PARTITION BY Cycle_Number ORDER BY Cycle_Number ) AS 'RowNumber'
Then in the reports’ footer total column we put an expression that only takes the first row’s value to sum and converts all other rows to zero in that windowed set.
=SUM(IIF(Fields!RowNumber.Value=1,Fields!Total_Running_hours.Value,0))
After using this if u found any error in textbox like #Error
Then try this
=SUM(IIF(Fields!RowNumber.Value=1,CDbl(Fields!Total_Running_hours.Value),CDbl(0.0)))