4 Replies Latest reply on Nov 25, 2015 9:07 PM by Kapil Gadhire

# Sum of distinct column combinations without duplication

Hi All,

I have the following table:

in which I have mapped a specific 'Planned_Value' for a particular combination of columns.

For Example :

Planned_Value for combination of : Consumer and Hyper Market and North 2 and Kids and Q2 1516 and Toys is 9.

[This particular combination is marked in red font color]

There are distinct combinations in my table, and each of the combination has a value assigned to it.

I need to sum all the distinct values for the combinations. [The combinations are coming only from the columns highlighted in green color.]

There are other columns as well in the table, which should not be considered.

To put it in nutshell, I want to sum the values associated with all distinct combinations(fixed multiple columns)

I have been trying to resolve this since last 2 days, but am not getting any solution for it! Hoping for a positive and quick response *Fingers crossed*

• ###### 1. Re: Sum of distinct column combinations without duplication

Kapil,

What do you mean by sum the values? Are you saying you want to count how many times 9 or 11 or other value occurs in the dataset? Its always helpful if you attach your dataset along with what you want to see as your expected result in Tableau.

• ###### 2. Re: Sum of distinct column combinations without duplication

Hi Kapil,

If I understand your question correctly you are looking to sum up the planned values for each of the unique combinations of the columns you highlighted. In the attached example I have set up a table calc to sum the values from each of the combinations. This set up uses the min of Planned Value and depends on there only being one planned value per combination. You can use the filters to decide which options are included.

Thanks,

Kent Sloan

InterWorks

• ###### 3. Re: Sum of distinct column combinations without duplication

Hey Kent,

Thank you for the response!

You have totally got the requirement right.

Instead of the table calculations, can we also have an expression to calculate the same. As I would want to use this calculate number(which you have calculated correctly) in other expressions as well.

• ###### 4. Re: Sum of distinct column combinations without duplication

Pooja!