Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
sifatnabil
Specialist
Specialist

Serialize month and year

Hi all,

I would like the month & year (e.g. Apr 2016) to be serialized where each month increases by 1. So for example, if my data starts from Oct 16, the serial field should look like this:

  

MonthYearSerial
Oct-161
Nov-162
Dec-163
Jan-174

How can this field be created? Thanks.

1 Solution

Accepted Solutions
marcus_sommer

Try it with: autonumber(MonthYear) as MonthYearSeriell

Edit: For this you will need a sorted load which is already quite common by using a master-calendar.

- Marcus

View solution in original post

2 Replies
marcus_sommer

Try it with: autonumber(MonthYear) as MonthYearSeriell

Edit: For this you will need a sorted load which is already quite common by using a master-calendar.

- Marcus

MK_QSL
MVP
MVP

Data:

Load

  *,

  If(MonthYear = Date#('Oct-16','MMM-YY'),

  1,

  1+ Year(MonthYear)*12+Month(MonthYear)-(Year(Date#('Oct-16','MMM-YY'))*12+Month(Date#('Oct-16','MMM-YY')))) as ID

;

Load

  Date#(MonthYear,'MMM-YY') as MonthYear

Inline

[

  MonthYear

  Oct-16

  Nov-16

  Dec-16

  Jan-17

];