4 Replies Latest reply on Nov 8, 2016 11:39 PM by anjani divi

# How to give DISTINCT for sum

Hi All,
in the tableau how can we use DISTINCT for summation?

for example:

sum(DISTINCT amount field)
i need to implement the same in tableau,
I found that we have DISTINCT for count in the tableau,  but i need to use for summation as well..:)
Can any one help on it ?

• ###### 1. Re: How to give DISTINCT for sum

Hi Anjani,

Find my approach as reference below

COUNT(amount) or COUNTD(amount)

and Total(count(amount))

• ###### 2. Re: How to give DISTINCT for sum

Hi Maijoor,
Thanks a lot,
but i need sum of amount with DISTINCT, not for the count
.

in the tableau we have DISTINCT with count, but how we will do for sum along with DISTINCT?

• ###### 3. Re: How to give DISTINCT for sum

I am trying to find out why you are using Distinct of Sums? I am just curious. Why don't give us more details of what you are trying to achieve with sample data and it will be more clear. Based on that we may come up with other workarounds rather than straight way, which doesn't work since both COUNTD and SUM are both aggregation and can;t further aggregated. Your solution can be easy as well as difficult based on your data structure, requirements and so on.

• ###### 4. Re: How to give DISTINCT for sum

Hi Sherzodbek,

i have qlikview calculation like this,
dimension is category
and metric is sum(DISTINCT invoice_amount)

based on the dimension i need to get distinct sum for invoic amount,

so same thing i need apply in the tableau as well, in the tableau  i found DICTINCT for Count,

but i need to use DISTINCT for Sum.

That's why i have posted in community for help

I hope you understand my problem.