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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
rajeshqvd
Creator II
Creator II

Year Month Autonumber should be incremental order

Hello All,

Required below  output in qlik script

this is coming for autonumber :


YM1.PNG

Required Output:

2019 Jan1
2019 Feb2
2019 Mar3
2019 Apr4
2019 May5
2019 Jun6
2019 Jul7
2019 Aug8
2019 Sep9
2019 Oct10
2019 Nov11
2019 Dec12
2020 Jan13
2020 Feb14
2020 Mar15
2020 Apr16
2020 May17
2020 Jun18
2020 Jul19
2020 Aug20
2020 Sep21
2020 Oct22
2020 Nov23
2020 Dec24

 

Note : don't use sort order and rec no().

 

Thanks

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

Try like: 

Table1:
Load
       YM,
       Date#(YM, 'YYYY MMM') as [YM Num]
From <>;
Tab2:
Load
      Autonumber(YM) as [YM Seq],
      YM
Resident Table1 Order By [YM Num];

 

View solution in original post

2 Replies
tresB
Champion III
Champion III

Try like: 

Table1:
Load
       YM,
       Date#(YM, 'YYYY MMM') as [YM Num]
From <>;
Tab2:
Load
      Autonumber(YM) as [YM Seq],
      YM
Resident Table1 Order By [YM Num];

 

Vegar
MVP
MVP

Autonumber is numbering your YM in order of firat appearance. If the first apperance in your data is 'November 2019' then it will be classed as 1. To ensure the desired autonumber order you need to control the order of first appearance for the field values in your data model.

This could be ensured I multiple ways, but most common would be using an order by or generate the dimension using a controlled script loop.