Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
rajeshqvd
Contributor 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
MVP
MVP

Re: Year Month Autonumber should be incremental order

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];

 

2 Replies
MVP
MVP

Re: Year Month Autonumber should be incremental order

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];

 

Partner
Partner

Re: Year Month Autonumber should be incremental order

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.
#OnVacation #BetweenJobs.
Please ekskuse my Norglish and Swenglish typos.