-
1. Re: Give me a correct calculation for total.
Sankarmagesh Rajan Apr 25, 2016 2:58 AM (in response to SUNDO KIM)Hi Sundo,
Don't do any calc like yours. Select analysis-total -column grand totals.
Thanks
sankar
-
2. Re: Give me a correct calculation for total.
Carl Slifer Apr 25, 2016 4:21 AM (in response to SUNDO KIM)2 of 2 people found this helpfulHowdy Sundo,
Is the Total field coming from your database? If so lets exclude that and put it as a context filter, because we do not want to use it at all. To make it a context Filter Right-Click the field on your filters shelf and then choose 'add to context'. Alternatively we can remove it as a datasource/extract filter as well.
Even if you follow Sankar's suggestion you will get the 'funky' values this is because how table calculations work. The default grand totals work without regard to the aliases they ran under. Your example of 5.24 * ( 12,253/12,253) = 5.24 is spot on.
So instead lets create a Level of Detail Calculation- for short we call these LODs. You can find more information about them here. http://interworks.co.uk/blog/tableau-level-detail-calculated-fields-v9/.
Our new calculation for Column C is
SUM([Column A])
*
(SUM([Column B])/MIN({FIXED : SUM([Column B])}))
Then Go to the Analysis Menu and Add Grand totals for Columns. Then repeat this but this time change the total using and switch it to SUM.
What this calculation does is very similar to what you had before but the FIXED function works different than the total function. The total looks at the table that's returned from the database while the FIXED function will look at the specific level of detail in this case none was defined so the entire database and sum for column B before. It then returns this result from the entire database in every row. Because its the same result for everything we had to use some level of aggregation in order to aggregate your other fields and use them both in maths at the same time. So by wrapping it in MIN we get the value aggregated (its the same value so max works as well).
Cheers!
-
3. Re: Give me a correct calculation for total.
Ashish Chaudhari Apr 25, 2016 5:36 AM (in response to SUNDO KIM) -
4. Re: Give me a correct calculation for total.
SUNDO KIM Apr 25, 2016 11:51 PM (in response to Sankarmagesh Rajan)my total came from there already. thanks.
-
5. Re: Give me a correct calculation for total.
SUNDO KIM Apr 25, 2016 11:51 PM (in response to Ashish Chaudhari)I did already. thanks.
-
6. Re: Give me a correct calculation for total.
SUNDO KIM Apr 25, 2016 10:31 PM (in response to Carl Slifer)It works! thank you!!!