Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to classify customers using calculated dimension?

Hi guys,

I have a sales table as below:

dateidcustidsalesorderamt
2011-01-12A1200
2011-04-13A2220
2012-03-23A3100
2012-05-18A4150
2012-03-03B1130
2012-06-08C180
2009-11-20D1130
2012-09-17D2180

When I select 2012-01-01<=dateid<=2013-12-31, I want get the following table:

StatusNo. of Client
New2
Existing1
Reactivated1

Defination:

New:Customers who have first purchase in 2012-01-01<=dateid<=2013-12-31,

Existing:Customer who both purchase in 2012-01-01<=dateid<=2013-12-31 and 2011-01-01<=dateid<=2012-12-31,

Reactivated:Customer who both purchase in 2012-01-01<=dateid<=2013-12-31 and before 2011-01-01.

That means for the 2012-01-01<=dateid<=2013-12-31,

A belongs to 'Existing',

B and C belong to 'New',

D belongs to 'Reactivated'.

Anyone has ideas?

Thanks a lot.

2 Replies
Not applicable
Author

Hi, sorry for forget the attached document.

Gysbert_Wassenaar

See attached qvw


talk is cheap, supply exceeds demand