I have a report in ssrs 2008, its data source is based on ssas.
I created a pie chart which shows total cost per shape. Dataset of the pie consists of only 4 fields.
Say i have 2 shapes, each of them has total cost. But in addition to that i also get a third slice in the pie which shows total of the other two.
How do i get rid of it?
Ok i figured it out luckily.
The problem was that my dataset returned the total, so i just filtered it in dataset filter expression.
I'm pretty sure there is a way not to return total inside dataset in the first place, if anyone knows, i will be glad to learn
In your dataset you want to change the expression to [Dimension].[Hierarchy].[Attribute].members or [Dimension].[Hierarchy].children. If you do [Dimension].[Hierarchy].members you will get the All member included.
Example: [Date].[Month].members will return each month plus the all member. [Date].[Month].[Month].members will return the members without the All member.
Related
I am working on a sample project in Power BI Report Builder. (I couldn't tag it as such because apparently I'm not allowed to create my own tags on this website.) The measure I am going for in my data cube is called Direct_Claim_Deductible_Recoverable_End_of_Year, but we will call it "Deductible" because that's too long a name to type out every time. I am trying to divide it up by the fields of State, City, and Year.
The Category column tells you whether each row is for a state or a city within that state. The Year and Location columns tell you the year and location that the row is telling you about. The Deductible column shows that measure. The Pct% column formula is Deductible - Total. (I added the Total column because I was having trouble with the Pct% column and wanted to know what was going on.)
Here's where the problem begins.
The Total column is supposed to tell me what the total deductible is for that specific year. But instead, it just gives me the grand total for all years in the cube. I've run the report enough times to know that this number is $99,669.71.
Here is the formula I am using for the Total column:
=round(Sum(Fields!Direct_Claim_Deductible_Recoverable_End_Of_Year.Value),2)
The Pct% column is giving me wrong answers too, but it is based on the Total column, so fixing the Total column should also fix the Pct% column.
And the data bar is supposed to show me what percent of the total for that year is in that state's row, or what percent of the total for that state is in that city's row. Instead it gives me an error message saying I am missing a closing parenthesis ')' somewhere:
The Maximum expression for the chart 'DataBar2' contains an error: [BC30198] ')' expected.
Here is the code I used:
=(Sum(Fields!Direct_Claim_Deductible_Recoverable_End_Of_Year.Value) / (Sum(Fields!Direct_Claim_Deductible_Recoverable_End_Of_Year.Value), "StateDS"))
As you can see, all three sets of parentheses are opened and closed.
I did figure out that if I move all the parentheses to the end, like so:
=(Sum(Fields!Direct_Claim_Deductible_Recoverable_End_Of_Year.Value) / (Sum(Fields!Direct_Claim_Deductible_Recoverable_End_Of_Year.Value, "StateDS")))
I resolve that error message but get a different one:
The ValueAxis_Primary.Maximum expression for the chart 'DataBar2' has a nested aggregate that specifies a dataset scope. Inner aggregates cannot specify a dataset scope.
It seems to be telling me that I cannot have the denominator of the fraction for the City data bar specify that its scope is the dataset "StateDS", which is the dataset that aggregates by State alone. But I am confused. I don't understand why that would be. And I don't understand what I need to do to make it aggregate by state anyway.
Thank you.
I'm creating a new report where one of my flags as to do with the Taxes we have here in Quebec. In this report, I'm displaying invoices with a header, the details (items) and then the total with the taxes.
Now here in Quebec we have TPS and TVQ as taxes. Sometimes, when we sell outside of the Quebec area at one of our other branch, we wont have the TVQ.
The goal of my flag, is to turn the textbox red when TPS is there and TVQ isn't there. I also want to do the same thing if TVQ is there and TPS isn't.
I kinda feel like it should look a little like that
IIF ((Fields!TAXDLID.Value = "TPS") AND (Fields!TAXDLID.Value = "TVQ"), black, red)
but I can't wrap my head around.
Thanks for the help!
edit:
Here is something that works and doesn't need red flags
Here is something that also works and doesn't need red flags
Here is something that does not work and would need a flags since it doesn't have TVQ
It's also possible to have nothing in the section
It's not perfectly clear what your dataset looks like (from your dataset query) so I have made some assumptions as follows:
Each row in your dataset has a Column that is either 'TPS' or 'TVQ'
Your dataset only contains data for a single invoice per report.
Your main report dataset is called dsMain
Assuming 1 invoice per report
Assuming the above, as your column can only contain one of two values we can simple count how many unique values are in the dataset.
You can do something like this
=IIF(CountDistinct(Fields!TAXDLID.Value,"dsMain") >1, "Black", "Red")
More than one invoice per report
If you are producing more than one invoice per report then I would imagine you have a row group setup that groups by invoice number. If this row group is called grpInvoice then you need to swap out the dsMain scope expression for the name of your row gorup
e.g.
=IIF(CountDistinct(Fields!TAXDLID.Value,"grpInvoice") >1, "Black", "Red")
Note
The scope name MUST be the exact spelling of the row group name or dataset name, it is case sensitive AND is must be enclosed in quotes as per the example.
If this does not help, please provide a sample of the data that comes from your dataset query and your report design including grouping info where applicable.
Say I have a dataset called TimeManagement and an aggregated value in an SSRS report as shown in lighter blue in the image below that I want to roll up within SSRS to create a sum total.
Row Groups
Aggregate (Lighter Blue)
=Sum(Fields!HoursMonth.Value, "Period1") / Sum(Fields!VisitsMonth.Value, "Period1")
Total (Darker Blue at the bottom
=Sum(Fields!HoursMonth.Value, "TimeManagement") / Sum(Fields!VisitsMonth.Value, "TimeManagement")
In this case I am creating an new average on the underlying data but what I really need is a sum of all the values shown in lighter blue. How do I go about achieving this?
You could change the scope of your second SUM() function to reference those values or a different group. Here's a good article from MSDN: http://msdn.microsoft.com/en-us/library/dd255256(v=sql.105).aspx
Get the sum totals from your stored procedure and use it as a column
My data and this SSRS chart have a ton of problems, I'll try to keep my question(s) succinct.
First, as you can see by this chart and this screenshot of my data (just showing date and April Savings), my expression/chart is not summing all of the savings within a month, which is my goal.
It appears to be picking one amount within the correct month and using it. I set up a tool tip for April so I could see what number it's pulling (since clearly the chart columns are not representing the data whatsoever - another issue).
You'll see in the SQL data screenshot that it does indeed pull $1,230 from the April 2013 Savings. How can I get this to Sum within the month AND still do a running value from the beginning of time data began to current, this often will include multiple years.
Here's my Chart Data (note that my Team Goal works perfectly, and is even charted correctly - but if anyone knows how to force that line to go from end to end on my chart, feel free to let me know.) :
To summarize, how can I sum each month's data, while still do a running value across the months AND years?
Here's my Expression for Implementable Savings:
=RunningValue(Sum(Fields!ImplementableSavings.Value), Sum, nothing)
(obviously if I can get one working, I can get both)
My Expression for ImplementedSavingsMonth:
=MonthName(Month(Fields!ImplementedSavingsDate.Value))
My Expression for ImplementedSavingsYear:
=Year(Fields!ImplementedSavingsDate.Value)
Let me know if there's anything else I can provide.
Quick sidebar question: WHY does my chart column collect one piece of data. IE: see the tool tip $1,230 for April 2013), but the chart column displays that the number is around $1.7M? And in this scenario, both of my blue and yellow columns are displaying the same number, so why does blue always appear to be a higher number? I will ask this as a 2nd question if it's inappropriate for me to ask here.
I would use this Expression for Implementable Savings:
= RunningValue ( Fields!ImplementableSavings.Value, Sum, "Chart1")
.. assuming your Chart's name is Chart1.
I have a requirement to show percentages in bar chart on a single bar using SSRS. For example, I want to show a employees by Age in a percentage in an SSRS report.
1.How many % employees between age 20 and 30?
2.How many % employees between age 30 and 40?
3.How many % employees between age 40 and 50?
All this on a chart which has only single bar chart in percentage?
Is it possible?
Thanks
Not sure I'm really understanding the question ("a chart which has only single bar chart in percentage"?), and I realise it's an old one, but I just came here with what I think is the same problem, and wanted to offer the solution I've come up with.
As far as I understand it, you have a bar chart which shows employees grouped by age. Age bracket along the X axis, number of employees (which I'll presume is calculated by something like "COUNT(Fields!EmployeeID.value)") up the Y axis. You want to see the percentage of employees which fall into each bracket.
What I've done is go into the chart properties, "Data" and select the "Values" entry for "Employees" (or similar). Then, hit Edit and add point labels, with a data label such as:
=COUNT(Fields!EmployeeID.value) / COUNT(Fields!EmployeeID.value, "Employees")
Where "Employees" is the name of your data set.
This is dividing the value of the current data group (from the "Values" tab) by same value but taken over the whole dataset.
Enter a format code of something like "#0%", et voila!
It achieved what I was after, and I hope it can help others with the same question.
You can easily do it in 2008, but I guess that's not what you wanted to hear.
So basically you want the concept of a pie-chart but as a single bar (known as a linear gauge in 2008)?
I don't think you can. This is about the limit of what you can do
http://msdn.microsoft.com/en-us/library/aa964128%28SQL.90%29.aspx
You could always buy dundas http://www.sql-server-performance.com/articles/reporting/Enhancing_Reporting_Services_with_Dundas_Reporting_Controls_p1.aspx
essentially this what MS have rolled into 2008