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

Duplicate customers - trend on place of visit

Hi All

i have a very long list of dataset and below is a subset of it. Appreciate if you could advise the scripts over here as i am using personal edition.

Based on the question table, i would like to know the repeat customers trend in their place visited. for example, for the same customer A, based on their earliest date of visit, they went to Europe and subsequently went to  China. with that i would like to have a table indicated below to sum up these trend of events by duplicate customer.

Please assist .

   

Question
Customer Place visitedDate of visit
AEurope10/4/2015
BChina14/9/2015
C Singapore18/11/2015
AChina20/9/2015
BEurope13/1/2015
C Singapore12/1/2016
DMalaysia13/2/2016

  

AnswerVisited place after their first visited place
Repeated Customer visited place based on earliest dateEuropeChinaSingaporeTotal
Europe 1 1
China1 1
Singapore 11
1 Solution

Accepted Solutions
sunny_talwar

Try this:

Table:

LOAD * INLINE [

    Customer, Place visited, Date of visit

    A, Europe, 10/4/2015

    B, China, 14/9/2015

    C, Singapore, 18/11/2015

    A, China, 20/9/2015

    B, Europe, 13/1/2016

    C, Singapore, 12/1/2016

    D, Malaysia, 13/2/2016

];

FinalTable:

LOAD *,

  If(Customer = Peek(Customer), Peek('Place visited')) as [Place visited Before]

Resident Table

Order By Customer, [Date of visit];

DROP Table Table;

View solution in original post

1 Reply
sunny_talwar

Try this:

Table:

LOAD * INLINE [

    Customer, Place visited, Date of visit

    A, Europe, 10/4/2015

    B, China, 14/9/2015

    C, Singapore, 18/11/2015

    A, China, 20/9/2015

    B, Europe, 13/1/2016

    C, Singapore, 12/1/2016

    D, Malaysia, 13/2/2016

];

FinalTable:

LOAD *,

  If(Customer = Peek(Customer), Peek('Place visited')) as [Place visited Before]

Resident Table

Order By Customer, [Date of visit];

DROP Table Table;