Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Numbering Months

Hi,

I am trying to create a table in Qlikview where I need number months starting Jan 2011 until August 2012.

Example:

Jan 2011 = month 1 and Aug 2012 = month 19. I have tried using the built num(month(field)) function and that only returns the months 1-12. Please let me know if anyone has a solution to this simple question.

Thank you,

Saurav

Tags (2)
1 Solution

Accepted Solutions
aaroncouran
Contributor III

Re: Numbering Months

If the table gets loaded in order (or do an ORDER BY (Date) in your load, then create a field AUTONUMBER(Month,Year) AS MonthYearNumber to get an integer for each month and year combination.

2 Replies
aaroncouran
Contributor III

Re: Numbering Months

If the table gets loaded in order (or do an ORDER BY (Date) in your load, then create a field AUTONUMBER(Month,Year) AS MonthYearNumber to get an integer for each month and year combination.

whiteline
Honored Contributor II

Re: Numbering Months

=(year(Date) - year(StartDate))*12 + month(Date) - Month(StartDate) + 1

StartDate - Jan 2011 (or you can use min() function)

Date - your periods.

Community Browser