4 Replies Latest reply on Oct 31, 2016 5:59 PM by Johnson Hwang

# How to get the % to total qty for each price range

I had data base Picture 1 as below , and i want use tableau to get the % to total qty for each price range like picture 2 as below. can anyone help? thanks. attached the tableau workbook and Excel spreadsheet for your reference

Picture 1 Picture 2 - final format • ###### 1. Re: How to get the % to total qty for each price range

I didn't get your numbers, but is something like this.

• ###### 2. Re: How to get the % to total qty for each price range

Hi Luciano, thanks for your help, why can not change the formula as below for Quartile field, it is the reason that you can't get my numbers i think

If     [Unit Price] <= percentile([Unit Price],0.25) Then '<=25% Quartile'

Elseif [Unit Price] <= percentile([Unit Price],0.5) Then '<=50% Quartile'

Elseif [Unit Price] <= percentile([Unit Price],0.75) Then '<=75% Quartile'

Else 'Max Price'

End

• ###### 3. Re: How to get the % to total qty for each price range

I thought you needed to set min and max price.

Did it work?

• ###### 4. Re: How to get the % to total qty for each price range

Hi Luciano

it doesn't work coz (max - min) /4 is not equal to percentile (Unit Price, 0.25), that why your result is not matched with mine. thanks

but when i used formula, the tableau reminder it contains error, not sure the reason. 