7 Replies Latest reply on Sep 18, 2018 5:33 PM by julian.ramirez.0

# Show all possible values pie chart (calculated field)

Hi all!

I have a calculater dimension like this:

If Price<5 then "<5"

elseif price>5 and price<10 then "5-10"

elseif price >10 and price <20 then  "10-20"

elseif price >20 and price <30 then "20-30"

else "No range"

END

The problem is with the data i have now, I can only see "<5" value in my legend. How can I do to show all possible values even if they aren't in my data?

Regards,

Julián

• ###### 1. Re: Show all possible values pie chart (calculated field)

hi Julian

Try with sum

If SUM([Price])<5 then "<5"

elseif SUM([Price])>5 and SUM([Price])<10 then "5-10"

elseif SUM([Price]) >10 and SUM([Price]) <20 then  "10-20"

elseif SUM([Price]) >20 and SUM([Price]) <30 then "20-30"

else "No range"

END

• ###### 2. Re: Show all possible values pie chart (calculated field)

Hi Julian,

if the derived dimension is fixed, make the same number of static sheet's and display some shape with the required color indicator. But place the same shape across all worksheets.

eg: Share screenshot is of static legends created using worksheets. Sathish

• ###### 3. Re: Show all possible values pie chart (calculated field)

Regards

• ###### 4. Re: Show all possible values pie chart (calculated field)

hi

thanks

sankar

• ###### 5. Re: Show all possible values pie chart (calculated field)

Can't see attached workbook

• ###### 6. Re: Show all possible values pie chart (calculated field)

Hi Julian,
Try this:

If price > 30 THEN ’30 +'
ELSEIF price > 20 THEN ’20-30’
ELSEIF Price > 10 THEN ’10-20
ELSEIF Price > 5 THEN ‘5-10’
ELSEIF price > 0 THEN ‘< 5’
ELSE ‘No Range’
END

Start with your highest category and work your way down to the end.  Tableau will do the 'between' calcs (< x and > y) automatically, by saying "x category is bigger than y category".

• ###### 7. Re: Show all possible values pie chart (calculated field)

Hi Eric,

Still the same. Values that are not now can't be shown