2 Replies Latest reply: Oct 16, 2016 7:51 AM by David GuÅ¡tin

# Calculate returning customers

Hi,

I want to calculate how many products bought return customers from last year in this year, regardless SALES_AGENT.

Should be 7 products... I can't figure out how to use SET analysis :-(

 CUSTOMER_ID PRODUCT QUARTER YEAR SALES_AGENT 1 FRUIT Q2 2015 JOHN 2 BEER Q2 2015 JOHN 3 BREAD Q2 2015 JOHN 4 EGGS Q2 2015 JOHN 5 PAPER Q2 2015 JOHN 1 BEER Q2 2015 JOHN 1 EGGS Q2 2015 JOHN 2 EGGS Q2 2015 JOHN 4 FRUIT Q2 2015 JOHN 1 FRUIT Q2 2016 JOHN 1 BEER Q2 2016 JOHN 1 EGGS Q2 2016 JOHN 2 BEER Q2 2016 GEORGE 4 EGGS Q2 2016 WILLY 4 FRUIT Q2 2016 WILLY 4 BREAD Q2 2016 WILLY 6 BREAD Q2 2016 MARTHA 6 EGGS Q2 2016 MARTHA 7 BEER Q2 2016 JANE 7 PAPER Q2 2016 JANE

Thanks!

• ###### Re: Calculate returning customers

Maybe this?

count({<CUSTOMER_ID=P({1<YEAR={2015}>})>} PRODUCT)

• ###### Re: Calculate returning customers

Hi John,

thanks for the answer. It gives me the correct result.

I also try:

=Count({<YEAR = {'2016'},

CUSTOMER_ID={"=COUNT({<YEAR = {'2015'}>}PRODUCT)>0"}

>} PRODUCT)

which is also one of the solutions.