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

Ranking question

I have the following information:

Client Name        Product              Purchase Date

1                              A                         1/1/2014

1                              B                         1/1/2014

1                              C                         3/1/2014

2                              A                         1/5/2014

2                               B                         2/1/2014

2                              C                         3/1/2014

3                              B                         1/7/2014

3                              A                         2/7/2014

3                              C                         5/7/2014

The first results I would like is:

First Purchase    Count of Clients

A                              2

B                              2

C                              0

The second one which is not easy is if I select Product A what is the next product that is purchased?

Thoughts are welcome.

David

1 Solution

Accepted Solutions
Gysbert_Wassenaar

See attached qvw. If the order history in your source table is not chronological you need to load the data first in a temporary table and do another load with an order by clause to order the data by customer first and purchase date second.


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
MK_QSL
MVP
MVP

Can you come back with the logic behind your result table?

Gysbert_Wassenaar

See attached qvw. If the order history in your source table is not chronological you need to load the data first in a temporary table and do another load with an order by clause to order the data by customer first and purchase date second.


talk is cheap, supply exceeds demand
Not applicable
Author

The logic behind my result table is:

Client 1 Purchased Product A first because of 1/1/2014 date being earliest and Client 2 Purchased Purchased Product A first because of 1/5/2014 date being the earliest so I have 2 clients that purchased Product A as their first purchase.  Same with Product B I have 2 clients that purchased Product B first.  I have no clients that purchased Product C first.  Does this make sense.

Not applicable
Author

Reply.  That did the trick.