I have created a CrossTab query that has financial quarters as columns, e.g. Q1, Q2, Q3, Q4. I added the columns to the property sheet of the query so they would always show and to prevent errors on the subsequent report.
When I run the report I total each of the columns at the bottom and then a grand total for all four columns. A column with nothing in it shows a blank total and causes the grand total to also be blank. How can I amend my grand total formula (=TQ1+TQ2+TQ3+TQ4) to exclude any empty column totals?
You can use Nz:
=Nz(TQ1,0)+Nz(TQ2,0)+Nz(TQ3,0)+Nz(TQ4,0)
Related
I'm creating a report that shows the sales of item before a date range and after a date range.
The part I ran into trouble with is the percentage difference between the total sales on Date 1 and Date 2.
Items can have no sales for a certain week.
The user can select multiple item ID's in the item ID parameter.
I can update the question to post my SQL query if needed.
What I've tried
Since I put a group on item ID I thought the First and Last functions would work.
Here's my expression on the column PCT.
=(Last(Fields!total_sales1.Value, "Date1")- First(Fields!total_sales1.Value, "Date1")) / First(Fields!total_sales1.Value, "Date1") * 100
But when I run the report I get the following results.
I need an expression on PCT column that will give me a percentage difference for each item pairs.
It looks like your scope is incorrect. Check what the rowgroup is called where you group by item id (let's say the row group is called "yourItemRowGroupName").
Then change you expression to use that scope rather than "Date1".
In fact you may not need the scope at all as it should work within the scope that expression sits (in your case, within your ItemID group.).
So try
=(Last(Fields!total_sales1.Value)- First(Fields!total_sales1.Value)) / First(Fields!total_sales1.Value) * 100
Or..
=(Last(Fields!total_sales1.Value, "yourItemRowGroupName")- First(Fields!total_sales1.Value, "yourItemRowGroupName")) / First(Fields!total_sales1.Value, "yourItemRowGroupName") * 100
You may have to handle divide by zero but try this to start with before you add any more complications.
I made a Tablix with Row and Column grouping that filters for the Top 10 highest. I also need Totals but it is totaling all of the records and of course I just want the total for the Top 10 ones in the table.
I tried using RunningValue but it doesn't reset with each Column Group.
How to get total of top 10 sales in SSRS 2012
Is there a way to only total the Top 10? I use the Dataset for other tables and charts so I'd rather not make separate ones (especially since I need the same functionality on other tables).
I have a data like
which comes from SSAS. Amount_YTD and Amount_YTE values are as Measures.
YTDs are Year-To-Date values, and YTEs are Year-To-End values regardless of Month filter.
My report design is
So, with this design, YTD and YTE values are SUMed (naturally) and what I get is
So row and column totals and grand totals are not as expected. This is what I would like to achieve,
(some rounding may occur)
How can I get "Expected" report?
For ALI you need to use MAX instead of sum for YTD and MIN instead of sum for YTE looking at your data.
For your other two summary lines toplam and Genel Toplam I would alter your ssas query so that it gives YTD and YTE figures regardless of both customer and month and use these figures in the YTD and YTE columns
I've this report
Here I make the first sum because I've grouped values from each month (months are "Gennaio", "Febbraio", "Marzo" etc etc.). These values are hidden, but anyway I get the sum and I display the sum for each month.
Then I should make the second sum that use values for each month and display the total for each category. Categories are "TOTALE LAVORI RESTAURO", "TOTALE LAVORI EDILE" etc.)
This is the final sum, where I sum values from each category.
Everything is working well, but now I have to add a "month" parameter to the report that returns sums until a selected month. This parameter changes the sum 1 with this expression:
=Sum(IIf(Fields!mese.Value <= Parameters!mese.Value, Fields!costi.Value, 0))
Now, how should I change expression in SUM2 and SUM3 to work with this parameter?
If I copy that code, ther returns #Error and as far as I know I can't use ReportItems sum.
So any suggestion?
SUM #1 could remain Sum(Fields!costi.Value) because you need to display every months.
i.e.: display GIUGNO even if Parameters!mese.Value = 4 (APRILE).
So you have only to change SUM #2 and #3 because TOTALE LAVORI RESTAURO and TOTALI must show only costi from GENNAIO to Parameters!mese.Value; i.e. if Parameters!mese.Value = 4 display only GENNAIO-APRILE even if we have details about GIUGNO.
The expression gave error because you have NULL value in Fields!costi.Value or Fields!mese.Value: convert this value to zero in your DataSet and you won't have problems.
I have a report with Year (which is a group) and then some other fields and totals (there are other groups that aren't relevant). I have a Grand Total Row at the bottom. I want to only show that row if there is more than 1 year in the report (otherwise it just duplicates the Year footer).
I am not sure what I can use to do this. I tried CountDistinct, but that is not in scope. Is there a way to get a count of the group sections (like Group("Year").SectionCount) or something?
I am using SSRS 2005.