6 Replies Latest reply on Nov 30, 2016 1:05 AM by Bilal Raja

# Need the tableau formula for Weighted Handling

Hi All,

I need to know the way out for the following calculation in tableau(10.1.1).

Weighted handling explains the importance / contribution (in terms of sales) of those shops  where a particular player is present(handled).

In the attached picture below, simple excel calculation is illustrated for understanding the formulation.

• ###### 1. Re: Need the tableau formula for Weighted Handling

Hi Bilal,

Using the original data in the picture you provided I was able to display the desired Weighed Handling values with the formula:
{ FIXED [Shops]: SUM([Sales]) } / { SUM([Sales]) }

I've included a sample workbook that illustrates the steps below:

1. Connect to the original data
2. Create a calculated field "Weighted Handling" with the formula: { FIXED [Shops]: SUM([Sales]) } / { SUM([Sales]) }
3. Place Player on Rows and Weighted Handling on Text

This formula uses Level of Detail expressions. More information can be found here:

Level of Detail Expressions (Product Help)

Let me know if this solves your question.

Best,
Sarah

1 of 1 people found this helpful
• ###### 2. Re: Need the tableau formula for Weighted Handling

Dear Sarah,

Thanks a bunch.

That's what i needed. However, i did not get the results after i applied it to the full data set.

Question 1: i am unable to figure out how you get percentage for the Weighted Handling. when i applied the same formula i did not get results in %.

I have attached my workbook. please look in to weighted handling sheet. This data has the waves(periods) and Cities. i have creates a calculated field "WD" with the formula: { FIXED [Shop Code]: SUM([Value])} / {SUM([Value]) }

Regards,

Bilal

1 of 1 people found this helpful
• ###### 3. Re: Need the tableau formula for Weighted Handling

Hi Bilal,

To display the WD values as a percentage you can change the default formatting for the WD field.

1. Right click on WD in the Measures pane
2. Click Default Properties > Number format...
3. Click Percentage > OK

Formatting (video)

Sarah

• ###### 4. Re: Need the tableau formula for Weighted Handling

Dear Sarah,

Thanks for guiding. Please also look into the issue in the attached file as well.

thanks.

• ###### 5. Re: Need the tableau formula for Weighted Handling

Hi Bilal, in the example you originally provided there are only two dimensions, Shop and Player. In this attached file we now have City, Wave, and Manufacturer so the calculation will likely need to be updated. You may need to add or change the Fixed fields in the LOD expression. Can you provide more details about what you are looking for and the expected results for the Weighted Handling worksheet?

• ###### 6. Re: Need the tableau formula for Weighted Handling

Dear Sarah,

I have figured out the additional dimensions to be added in the Fixed fields

Below worked for what i needed.

{ FIXED [Shop Code], [Wave], [City1]: SUM([Value])} / {FIXED [Wave], [City1]: SUM([Value]) }