4 Replies Latest reply on Aug 28, 2017 1:35 PM by arun.chanda

# Pie Chart with Parameter control

How to Create a Pie Chart with 3 segments where

Segment 1: No. of Customers with profit >x%

Segment 2: No. of Customers with profit <y%

Segment 3: No. of Customers with profit x-y%

x, y are parameters

Lets take Superstore Data

• ###### 1. Re: Pie Chart with Parameter control

Hi Arun,

Assuming you have a field [Profit] and that [X] and [Y] parameters are such that X=10 means 10%, you can do the following:

1) Select Pie Chart on the marks card.

2) Put formula COUNTD([Customer]) on the Angle card.

3) Create a calculated field with the following formula that you drag onto the color card:

if [Profit]>[x]/100 then ">"+STR([x])+"%"

elseif [Profit]<[y]/100 then "<"+STR([y])+"%"

else str([x])+"-"+STR([y])+"%"

END

Does that help?

Michael

• ###### 2. Re: Pie Chart with Parameter control

What have you tried so far?

When you say, "Let's take superstore data", are you implying that you want someone to set it all up for you in superstore?

What really should happen here is that you take a good stab at it.  Create the two parameters.  Create the three calcs.  Do it in the version of Tableau that you have installed so that I don't set it up in a higher version and then you say, "I can't read that version.  My version is X."

• ###### 3. Re: Pie Chart with Parameter control

Thanks Michael

This logic definitely helps

• ###### 4. Re: Pie Chart with Parameter control

Hi Joe

Actually I am working on a real-time project which I can't attach here and that's why I told Superstore data.

Have created 2 parameters and tried with Sets, anyway now it's working with Calculated fields

Anyway Thanks for your reply on my query