Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Specialist
Specialist

Intersection: How to get customer count present in consequtive months

Hi All,

I have data set as attached below.

I want to create a chart which shows count of customer id who are in current month as well as previous month( i.e. the common customer id count). The chart is like shown below.

ex.

Month Count

Jan      0

Feb      4

Mar      3

Please help.

Regards

Ankit

1 Solution

Accepted Solutions
Highlighted
Not applicable

Re: Intersection: How to get customer count present in consequtive months

Hi Ankit,

Try the following code:

Tab1:

LOAD Month,

     [Customer Id],

     AutoNumber(Month) As Month_ID

FROM

[..\Downloads\New Microsoft Excel Worksheet.xlsx]

(ooxml, embedded labels, table is Sheet1) ;

Month.jpg

NoConcatenate

Tab3:

LOAD *,

  if(peek('Customer Id')=[Customer Id] and peek('Month_ID')=Month_ID-1,1,0) as Flag

   Resident Tab1 order by [Customer Id] ,Month_ID asc;

  DROP Table Tab1;

Regards,

Jemimah

View solution in original post

2 Replies
Highlighted
Not applicable

Re: Intersection: How to get customer count present in consequtive months

Hi Ankit,

Try the following code:

Tab1:

LOAD Month,

     [Customer Id],

     AutoNumber(Month) As Month_ID

FROM

[..\Downloads\New Microsoft Excel Worksheet.xlsx]

(ooxml, embedded labels, table is Sheet1) ;

Month.jpg

NoConcatenate

Tab3:

LOAD *,

  if(peek('Customer Id')=[Customer Id] and peek('Month_ID')=Month_ID-1,1,0) as Flag

   Resident Tab1 order by [Customer Id] ,Month_ID asc;

  DROP Table Tab1;

Regards,

Jemimah

View solution in original post

Highlighted
Specialist
Specialist

Re: Intersection: How to get customer count present in consequtive months

Any idea of doing this from front end and not backend scripting?