0
votes

I have created a calculated field [Segment] using the below codes. CalculationZ is also a calculated field. I need to convert the calculated field Segment to a dimension. Is it possible in tableau. Please share the codes or formula/ methods to achieve this

IF  [CalculationZ] < 0.10 THEN
"A1"
ELSEIF [CalculationZ] >= 0.10 and [CalculationZ] < 0.20 THEN
"A2"

ELSEIF [CalculationZ] >= 0.20 and [CalculationZ] < 0.30 THEN
"A3"
ELSEIF [CalculationZ] >= 0.30 and [CalculationZ] < 0.40 THEN
"A4"
ELSEIF [CalculationZ] >= 0.40 and [CalculationZ] < 0.50 THEN
"A5"
ELSEIF [CalculationZ] >= 0.50 and [CalculationZ] < 0.60 THEN
"A6"
ELSEIF [CalculationZ] >= 0.60 and [CalculationZ] < 0.70 THEN
"A7"
ELSEIF [CalculationZ] >= 0.70 and [CalculationZ] < 0.80 THEN
"A8"
ELSEIF [CalculationZ] >= 0.80 and [CalculationZ] < 0.90 THEN
"A9"
ELSEIF [CalculationZ] >= 0.90 and [CalculationZ] <= 1.00 THEN
"A10"
else  "A0"
END
1
I believe you can convert the calculated field [Segment] into Dimensions in one of two ways: (1) drag and drop the field from measures to dimensions list on the left, or (2) when it's in row/column area you can open the options by clicking on the down arrow on the right side of the field pill and select 'Dimensions' option - katychuang
It doesn't work this way. It remains as a measure. - Raj Sekhar
@RajSekhar, it should work that way :) - Jose Cherian
Correct from below - I think you can just drag the measure to dimensions. For that formula - creating a custom bin on calculationz may help. - Hatt

1 Answers

0
votes

Just drag the field to dimensions. enter image description here

You can even use a field as measure and dimension in a single view. See how calculationZ is used as a dimension and measure in below view.

enter image description here enter image description here