4 Replies Latest reply on Aug 19, 2016 8:45 AM by mohamedferozkhan.m

# Calculated Field Based on the Dimension Not showing

Hi,

I am have following data and created two calculated field based on the Dimension . Then created one more field adding two calculated field fields. The third calculated field not showing anything. Any idea why it is not showing. Please help

1. Cash on Hand LCY = If [Asset Type1]="Cash On Hand" then [Local Currency] END

2. Claims on Bank LCY = if [Asset Type1]="Claims on Bank" then [Local Currency] END

3. COH_COB = [Cash on Hand LCY]+[Claims on Bank LCY]

• ###### 1. Re: Calculated Field Based on the Dimension Not showing

What happens if you change your formula to:

COH_COB = SUM([Cash on Hand LCY])+SUM([Claims on Bank LCY])

• ###### 2. Re: Calculated Field Based on the Dimension Not showing

Thank you Andrew. Now it is working. I would like to know what is the reason behind giving "Sum" while adding up. Also noticed that under "Measure Values" section it shows AGG(COH_COB). Please explain as I am new to Tableau.

• ###### 3. Re: Calculated Field Based on the Dimension Not showing

It says AGG as the aggregation has already happened within the calculation - it can't be further aggregated.

Great question around why the 2 values need to be summed inside the calculation. I believe it's because the 2 calculations inside while unaggregated contradict each other so return nothing - similar to saying IF AssetType = 'Cash on Hand' AND AssetType = 'Claims on Bank' THEN LocalCurrency'.

Summing the 2 values separately forces them to calculated separately and sum the results.