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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to make AutoNumber() with group display continuously

I am using AutonNumber() with groups to create my serial values to using in future calculations.  The grouping are working but the numbers skip the next values as seen below.

Notice below that MyWeekSerial continues sequencially.  Week 4 then 5 then 6 but my month goes from 2 to 7 instead of 2 to 3. 

Can anyone help with this?  Thanks

Load   
    DayID
   
Year(DayID)    AS MyYear,
   
Week(DayID)    As MyWeek,
   
Month(DayID)   as MyMonth,
   
Day(DayID) as myDay,
   
AutoNumber(Year(DayID) & Week(DayID))    AS MyWeekSerial,
   
AutoNumber(Year(DayID) & Month(DayID))    AS MyMonthSerial

From myCalendar;

Returned values are:

DayID           MyWeek      MyMonth      MyWeekSerial      MyMonthSerial

1/18/2013      3                Jan                4                           2

1/19/2013      3                Jan                4                           2

1/20/2013      3                Jan                4                           2

1/21/2013      4                Jan                5                           2

1/22/2013      4                Jan                5                           2

1/23/2013      4                Jan                5                           2

1/24/2013      4                Jan                5                           2

1/25/2013      4                Jan                5                           2

1/26/2013      4                Jan                5                           2

1/27/2013      4                Jan                5                           2

1/28/2013      5                Jan                6                           2

1/29/2013      5                Jan                6                           2

1/30/2013      5                Jan                6                           2

1/31/2013      5                Jan                6                           2

2/1/2013        5                Feb                6                           7

2/2/2013        5                Feb                6                           7

11 Replies
anbu1984
Master III
Master III

You cannot use Order by on QVD. Try like this

Temp:

Load  *

from Data.QVD (qvd);

Final:

Load  * Resident Temp Order By Field;

Drop table Temp;

From QV Help

order by is a clause used for sorting the records of a resident table before they are processed by the load statement. The resident table can be sorted by one or more fields in ascending or descending order. The sorting is made primarily by numeric value and secondarily by national ASCII value. This clause may only be used when the data source is a resident table. The ordering fields specify which fields the resident table is sorted by. The field can be specified by its name or by its number in the resident table (the first field is number 1).

Not applicable
Author

Say, I am using AutoNumber to assign a unique ID to the combination of Week & Year in two different tables. These Tables in the data model are not connected
.but still autonumber assigns the same id to the same combinations although these combinations might be coming from different tables. is this always the case?