3 Replies Latest reply on Feb 28, 2013 10:12 AM by Pulkit Saxena

# How to calculate relative percentage from max - market share indexing

Hi, I was trying to create an index of market share for certain values but cant figure out how.

Essentially i have a data set (just an example) with 3 different product - X,Y,Z which are in 3 different cities.

Say for city - NYC X has market share 10%, Y - 20% and Z 18%.

Now an index would be -

for X - 10% / max (X,Y,Z) = 10%/20% = 0.5

for Y - 20% / max( X,Y,Z) = 20%/20% = 1

and so on..

So if i have 3 different cities it should take the market share of a product and divide by max market share of that city.

Any ideas would be of great help!

Pulkit

• ###### 1. Re: How to calculate relative percentage from max - market share indexing

Hi Pulkit,

You may need to use a table calculation like WINDOW_MAX() to do this, which will find the max value over a specified "partition" (table, pane, or other dimension in the view). Tableau has an intro video Table Calculations | Tableau Software

It's hard to give you a specific recommendation, because table calcs depend on the worksheet fields and your chart. If you post as sample workbook (zipped twbx) with some sample data it would be easier.

Jim

• ###### 2. Re: How to calculate relative percentage from max - market share indexing

Hey Jim,

Attached is a sample data set.

What I am trying to achieve is -

For each product - Sum of Sales / max (Sum of sales)    From Column D.

So for product X for the city 'a' the answer value would be 150 /150 = 1 and for product Y for city 'a' the value would be 75 /150 = 0.5

I want to plot them against the market growth rate (for each city).

The view should display the product that you select and not all at the same time. So probably have a parameter which says choose product and one would Choose x/y/z and so on.

Hope this helps you understand my problem.

Cheers,

Pulkit

• ###### 3. Re: How to calculate relative percentage from max - market share indexing

I put something together, which performs the required functionality. It works fine if all products are selected but as soon you filter out the product with Index as 1 all other values change.

If you have any way in which we could select just 1 product and have the values remain the same, that will be great.

Cheers,

Pulkit