IIF expression for Count for division - reporting-services

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?

Related

SSRS Sum Amounts with different columns based on an expression

So i am trying to sum columns based on a condition from one group to another.
The first column is the expression that counts how many Meters are in that group by company.
in the photo it shows eight by that company that have a value of meter,
Then to the right is invoice amount
What i need to do is a conditional format for the expression that says if x company has 8 meters what is the total amount for all invoices that = meter.
I have tried a few ways but unable to get the count out of the expression under the column so i know it has something to do with my condition statement and not sure wher it is going wrong any help would be appreciated
=Sum(IIf(Fields!invoiceclass.Value = "METER" and Fields!companyname.Value, Fields!invoiceamount.Value , Nothing), "AR")
Try using:
=Sum(IIf(Fields!invoiceclass.Value = "METER", Fields!invoiceamount.Value,0))
I think you don't need to specify a scope since you want the sum be calculated per instance in the company group and you are using the expression in a cell inside the Company group scope.
Let me know if this helps.

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.

How to get overall total in row group

I have a row group in SSRS that calculates totals by each group. However, I would like to get the percentage of each group out of the overall total. However, I do not know how to achieve getting the overall total to work within the same expression.
Right now I have this to get my total of each group:
=Sum(Iif(IsNothing(Fields!ID.Value),0,Iif(Fields!STATUS.Value = "Closed",1,0)))
But I am not sure how to divide that by the overall total. Would anyone have any ideas?
You will need to apply the same expression, but in a different Scope.
e.g. to get the total for the whole Dataset, you will need something like:
=Sum(Iif(IsNothing(Fields!ID.Value),0,Iif(Fields!STATUS.Value = "Closed",1,0)), "DataSet1")
Where DataSet1 is the name of the Dataset used by the Table.
Once you have this new expression, simply divide the Row total expression by the Dataset total expression to get the percentage.

SSRS IIF expression for Counting Division

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.

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)))