4 Replies Latest reply on Feb 14, 2019 6:44 AM by Paul Wachtler

# How to find sum of distinct for a single measure column?

I have a requirement like we have to find the sum of distinct for a single measure column across a dimension field. we are using a live data source because of that not able to make use of the fixed functionality. Could anyone of have any idea for this issue.

i am adding more details to this post.

We have a field named Plan where we are suppose to take distinct value. we are calculating the plan value with respect to PN column, PN column may have 2 or more sub types.

Eg: AA is a value in PN Column which have two sub types named AA-hw & AA-sw. PFB screenshot for more details:

If anyone have a solution to solve this issue, it will be highly helpful and appreciated. I am attaching a demo work book and sample data as in our data source.

Ajith V S.

Message was edited by: Ajith Suresh on Feb-13

• ###### 1. Re: How to find sum of distinct for a single measure column?

Hi Ajith,

Could you give me a little more help with what your initial data looks like and the outcome you're trying to achieve? Just some dummy data would be perfect.

Thanks!

• ###### 2. Re: How to find sum of distinct for a single measure column?

Hi Ajith,

You can certainly use a FIXED LOD with a live data connection - not sure why you think you can't.  That's how I solved this.

To get your total plan value, I created a field called Plan Value Total like this:

sum({FIXED [PN], [PN Type]: max([Plan])})

That gives you the total you're looking for.

Best,

Paul

• ###### 3. Re: How to find sum of distinct for a single measure column?

Hi Paul,

For some data sources tableau does not support LOD expressions. We are using Actian Vector data source which does not support this feature. PFB link for reference:

Do you have any other solution for this issue.

Thanks,

Ajith V S.

• ###### 4. Re: How to find sum of distinct for a single measure column?

Hi Ajith,

Never heard of Actian Vector before but I see that LODs aren't an option here.  This means that you either need to include the PN Type field in your viz (since you need the calculations done at that level of detail) or you need to do the calculations in your datasource before bringing them into Tableau.

Paul