Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count number of months

Hi,  I'm new in Qlikview and what I need to do is count numbers of month of operation for the different stores... How do I do that?... For example if a store started sale since July 2015 for July I must to count 1 and 2 for August... I want to do this creating a new dimension in Script Editor...

Please help.

10 Replies
maxgro
MVP
MVP

another option could be

1.png

a:

load [SALE DATE], MONTH inline [

SALE DATE, MONTH, OPERATION MONTH

20150212, 02, 1

20150212, 02, 1

20150212, 02, 1

20150213, 02, 1

20150213, 02, 1

20150219, 02, 1

20150316, 03, 2

20150327, 03, 2

20150430, 04, 3

20150522, 05, 3

];

b:

NoConcatenate load

  [SALE DATE],

  MONTH,

  if(left([SALE DATE],6)=left(Peek('SALE DATE'),6),

          Peek(MonthSequence),

          Alt(Peek(MonthSequence),0)+1) as MonthSequence

Resident a

order by [SALE DATE];

DROP Table a;