-
1. Re: grand total on first row
Tracy RodgersJul 14, 2014 10:44 AM (in response to manoj.kasam)
Hi Manoj,
One possible way this can be done would be by using the suggestion from Andy here:
Another suggestion can be found here:
How do I move the location of the "Grand Total" row to the top
Re: Grand Total at top of report
There is also an idea you may want to vote up here:
http://community.tableau.com/ideas/1320
-Tracy
-
2. Re: grand total on first row
Matt LuttonJul 14, 2014 12:22 PM (in response to Tracy Rodgers)
I'm not sure any of those suggestions will work for this view, since there are multiple years in the view and he is actually wanting his "Subtotals" to come first in a series of dimension values.
-
3. Re: grand total on first row
manoj.kasam Jul 14, 2014 12:24 PM (in response to Matt Lutton)Hi Matthew,
I think you are correct, I need subtotals as first bar..do you have any suggestions..
-
4. Re: grand total on first row
Matt LuttonJul 14, 2014 12:32 PM (in response to manoj.kasam)
I believe you can edit your data source with some Custom SQL to add a "subtotal" member to your Dimension, but I'm not very good at this type of thing.
You might find a solution in one of these threads:
Customizing Grand Totals – Part 3 | Drawing with Numbers
Re: Formatting Question - Can the Grand Row Totals be shown on the left side of the view?
How do I move the location of the "Grand Total" row to the top
-
5. Re: grand total on first row
Aaron Clancy Jul 14, 2014 2:07 PM (in response to Matt Lutton)To modify the SQL to get a subtotal you could do the following:
SELECT
[Table].[Container] AS [Container],
[Table].[Order Date] AS [Order Date],
[Table].[Profit] AS [Profit]
FROM [Table]
UNION ALL
(SELECT
"Total" AS [Container],
[Table].[Order Date] AS [Order Date],
sum([Table].[Profit]) as [Profit]
FROM [Table]
group by [Order Date],[Container])
This will give you a rolled up total value for each date/Category.
The output will look like the following: (I removed the table calc cause I'm not sure what you're trying to do so I'm keeping things simple.
If you describe more about what is needed I can show you how you can use table calcs "around" the subtotals.
-
6. Re: grand total on first row
Aaron Clancy Jul 14, 2014 2:32 PM (in response to Aaron Clancy)After looking at your requirement more, I don't know that the Custom SQL route is the greatest. It does give you a placeholder though for "Totals" that can be moved to the left. After this you could use calcs to determine totals for whatever window you specify.
This is an example that does some tricky calculations to get the running sum of profit totals, although, conceptually, asking this from a visual is very confusing. You're putting the running sum total in from of marks that that total will contain.
If this is closer to the output you're looking for then I can walk through the calcs.
-
7. Re: grand total on first row
manoj.kasam Jul 14, 2014 3:37 PM (in response to Aaron Clancy)Hi Aaron,
Only Total bars should be broken done by each month..and for reamining profit bars,,should be runningtotal broken down by container and month..
is this possible..
I did union all query I was able to do table calculation of running totals for Profit including totals bars which I don't want..
pls let me know how can I do running total of only profit bars by conainers and month and not for total bars..
-
8. Re: grand total on first row
Aaron Clancy Jul 14, 2014 3:58 PM (in response to manoj.kasam)Yep, you need to not account for your totals in the running sum.
Computed Running Sum:
if attr([Container]) = 'Total' then previous_value(1) else sum([Profit]) + previous_value(1) end
This "skips" the "Total" field and keeps the position of the last field of the previous pane.
-
9. Re: grand total on first row
manoj.kasam Jul 16, 2014 12:05 PM (in response to Aaron Clancy)Hi Aaron,
how do I reset running totals to break down for each year instead of continuing running totals..
-
10. Re: grand total on first row
Aaron Clancy Jul 16, 2014 12:07 PM (in response to manoj.kasam)Set the compute using to pane across.