Calculation issue: Distinct sum in Tableau

0 votes

Dataset Description:

Columns: Brand, Market and Target.

Following dataset represent the target for four different brands A,B, C & D which are distributed among OPL & CPL market.

enter image description here
What I want?

 

Sum of Target for each of Brand at OPL (highlighted in orange) and sum of Target for each of Brand at CPL (highlighted in yellow)

For example, 

sum for OPL should be 10000 + 7000 + 4000 + 9000 = 30000 and,

sum for CPL should be 5000 + 2000 + 8000 + 3000 = 18000

What I did?

I used this logic: IF [Market] = 'OPL' THEN {FIXED [Brand]+[Market] : MIN([Target])} END

Image as below:

enter image description here

The logic gave me total of target at OPL which is 58000,( which is not the one I wanted).

Can someone help me with the calculation part?

May 8, 2018 in Tableau by N. Reddy
1,510 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
SUM( { FIXED [Brand], [Market]: AVG(Target) } )

Performing average within each Market and Brand will eliminate the duplicates in your sum.

answered May 8, 2018 by Atul
• 10,170 points
How can we find distinct sum for actian vector datasource?
we can find distinct sum using LOD in Tableau (works for all versions after 9.0)

However, according to Data Constraints, Action Vectors aren't supported by LOD in Tableau

Related Questions In Tableau

0 votes
1 answer

In Tableau, How to sum the last 7 days of the value?

It can be achieved easily by creating ...READ MORE

answered Mar 12 in Tableau by CHERUKURI
• 12,420 points
57 views
0 votes
1 answer

Sum Filtered Data in Tableau

Hi Anitha, Its quite simple, To use a ...READ MORE

answered Mar 13 in Tableau by CHERUKURI
• 12,420 points
30 views
0 votes
1 answer

Sum two columns together in Tableau

Hi Anitha,  You can find sum of two ...READ MORE

answered Mar 18 in Tableau by CHERUKURI
• 12,420 points
27 views
0 votes
1 answer

Reset filters in Tableau

I understood your question (I hope so!). ...READ MORE

answered Mar 29, 2018 in Tableau by QueenBee
• 1,810 points
276 views
0 votes
1 answer

Calculated filed with if-then

Below is the required code:  IF (NOT ISNULL([test2])) ...READ MORE

answered Mar 27, 2018 in Tableau by Atul
• 10,170 points
35 views
0 votes
1 answer

How to calculate profit when cost and revenue are in same column?

You can create the following calculated fields: Profit: SUM(IIF([account_category] ...READ MORE

answered Apr 10, 2018 in Tableau by Atul
• 5,470 points
44 views
0 votes
1 answer

Creating a calculated field with LOD expression

Go ahead and try the following three ...READ MORE

answered Apr 20, 2018 in Tableau by Atul
• 5,470 points
54 views
0 votes
1 answer

Creating a calculated field for summing up the values

Well you can use this in your ...READ MORE

answered May 17, 2018 in Tableau by Atul
• 5,470 points
28 views
0 votes
1 answer

How to color code cells of a column based on the text value in Tableau

You can use the following steps to ...READ MORE

answered Mar 27, 2018 in Tableau by Atul
• 10,170 points
896 views
0 votes
1 answer

How can I count the aggregate function in Tableau

Create two calculated fields one for 100's ...READ MORE

answered Apr 5, 2018 in Tableau by Atul
• 10,170 points
912 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.