5 Replies Latest reply on Apr 19, 2018 8:52 AM by DIVYA TIKKISETTI

# Calcuation (using LOD's )

Hi Folks,

I have a case where I need to check 2 calculations seperately and build my output.

Calculation 1 : This should give me the customer list whose GSV is greater than 100euros in current year.  So Tableau calculation I used is

IF ({ INCLUDE  YEAR,CUSTOMER ID  : SUM(GSV)}>=100 )

THEN CUSTOMER ID

END

Calculation 2 :  This should give me the list of customers whose has purchased >= 5 products and the sale value of each product should be greater than 0 euros.

IF  ({ INCLUDE YEAR,CUSTOMER ID: COUNTD(PRODUCT CODE)}>=5  and

{INCLUDE YEAR,CUSTOMER ID,PRODUCT CODE :SUM(GSV)}>0 )

THEN (CUSTOMER ID)

END

So my result should give me only those customers who are part of both Calculation 1 and Calculation 2.

I am not able to fit everything in one calculation without dragging any dimensions in view.  Please help me achieve this.Please find the attached Tableau workbook.( The results/no of rows resulting in the workbook for calculation 1 and calculation 2 are correct

Calculation 1 resulting 215 customers

Calculation 2 resultsing 125 customers

so I need 125 as output.

Thanks

Divya

• ###### 1. Re: Calcuation (using LOD's )

Hi, Divya

Any sample workbook can be shared so that will be easier for people here to help?

ZZ

• ###### 2. Re: Calcuation (using LOD's )

Good morning

your workbook did not come across so I did the attached superstore example with your formulas (slightly modified)

this is the result for your formulas as written

I converted the first formula to a filter

and place it on the filter shelf to true and now the formula 2 values are filtered by formula 1

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

• ###### 3. Re: Calcuation (using LOD's )

Hi folks,

Thanks for the response. I have attached workbook now to the original post. Please refer and let me know.

Hey Jim,

For ex lets say we have total customers as 200. So now both of my calculations should query 200 rows. Calculation 1 may return 100 and calculation 2 may return 125. Common customers needs to be taken.

But As per your result, if Calculation 1 is querying and resulting 100 count customers  and calculation 2 is querying output of calculation 1 ( that is only 100 customers are being considered for countd (product code) which might not be the expected solution.

May be I am going wrong. Please correct my understanding.

• ###### 4. Re: Calcuation (using LOD's )

Hi, Divya

Hope this helps

ZZ

• ###### 5. Re: Calcuation (using LOD's )

Hi Zhabg,

Both the calculations are perfectly giving expected results.

But the output I need the common customer count between both the calculations.

How can this be achieved ?