
Hi All,
I am trying to get a calculation done however there seems to be an issue.
PFA workbook in which the field name 'Test' is not showing any value.
Please help
Thanks
You have not aggregated anything in your calculation. In the view, the values are aggregated with a SUM(), so your calculation will need to do the same, I imagine (see screenshot below for clarity on what I mean -- you had aggregated the values you were displaying, but your Calculated Field did not include any aggregations).
sum(abs([Negative Inv Amt Value]))/sum([Onhand Amt Value])
Then, set your default number formatting to a percentage with at least 2-3 decimal places, as this will return very small values:
I would recommend anyone trying to help on this Forum, be sure you understand the problem before attempting an answer. By opening the workbook, and looking at the calculation, the problem becomes much easier to understand and we no longer have to guess at an answer. That is, assuming we have learned about the types of calculations available in Tableau, and how they differ. Those types of calcs include: row level, aggregate, and Table Calculations. In this example, a Row Level calc was originally created -- this would take the row level values and divide them, when what the OP wants is to SUM the data at the level of detail set by the Dimensions in the view. So, the problem in this workbook was that the Calculation was not aggregating, when what we were expecting was an aggregation at a specific level of detail (again, this is set by the active Dimensions in the view--in this example, those Dimensions are the Product and Negative Inv Date dimensions). I hope this helps in understanding what the problem was.
There is a pretty good article on this topic 9the difference between row level and aggregate calcs) here: Tableau for Excel users – Part 2 - Calculated fields - The Information Lab
Let's avoid the temptation to throw out guesses, wherever possible, particularly when a user takes the time to create a sample packaged workbook, and they have clearly defined the problem they're experiencing. In addition, instead of just throwing out suggestions, explain the WHY of what you're suggesting, and provide as much detail as you can when answering a question on this Forum.
Just some suggestions for those newer folks trying to help out on the Forums.
A version 8.2 TWBX of your workbook is attached to demonstrate.