Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
samuel_lin
Creator
Creator

Create a customized dimension for customers who purchased in 2015 but not 2016?

Hello Qlikers!!

I am trying to create a customized dimension to segment out customers who have purchased in both 2015 and 2016, and 2015 only.

right now, I have

-------------------

Aggr(

  If(aggr(sum({<LineType={'Shipped', 'Returned'}, CategoryID={'>0'}, Year([order date])={'2015'}>} ExtRevenue), MasterContactID)>0 and

  aggr(sum({<LineType={'Shipped', 'Returned'}, CategoryID={'>0'}, Year([order date])={'2016'}>} ExtRevenue), MasterContactID)>0,

    Dual('2015&2016', 1),

   

  If(aggr(sum({<LineType={'Shipped', 'Returned'}, CategoryID={'>0'}, Year([order date])={'2015'}>} ExtRevenue), MasterContactID)>0 and

  aggr(sum({<LineType={'Shipped', 'Returned'}, CategoryID={'>0'}, Year([order date])={'2016'}>} ExtRevenue), MasterContactID)=0,

  Dual('2015&-2016', 2)

 

  ))

, MasterContactID)

-----------------

it's not working properly, not sure if it's because I have two aggr() function in each if()?

superly appreciate your help~

Samuel

11 Replies
sfatoux72
Partner - Specialist
Partner - Specialist

Bonjour Samuel,

Si une de ces réponse est correcte, veuillez mettre cette question comme résolue pour aider les autres membres de la communauté qui auraient le même problème que vous.

Merci

samuel_lin
Creator
Creator
Author

Hi Sebastien,

your previous response was correct and worked, I am conducting some tests and will mark your answer as correct soon. Thank you for the reminder!

Thank you everyone for your help, Happy New Year!