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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
fosterma
Contributor III
Contributor III

AutoNumber 1-4

Hello, hopefully a quick one

I have a range of values that I want to autonumber from 1-4 in sequence, without a dimension to group the values. 

For Example:
1111,1
1112.2
1113,3
1114,4
1115,1
1116,2
1117,3
1118,4
1119,1

1 Solution

Accepted Solutions
treysmithdev
Partner Ambassador
Partner Ambassador

Would something like this fit your use case?

 

data:
Load 
    RowNo() as Row,
    Id,
    Replace(Mod(RowNo(),4),'0','4') as FormulaA,
    Mod(RowNo()-1,4)+1 as FormulaB,
    Goal
Inline [
    Id, Goal
    1111,1
    1112,2
    1113,3
    1114,4
    1115,1
    1116,2
    1117,3
    1118,4
    1119,1
];

 

 

Output:

clipboard_image_0.png

Blog: WhereClause   Twitter: @treysmithdev

View solution in original post

2 Replies
treysmithdev
Partner Ambassador
Partner Ambassador

Would something like this fit your use case?

 

data:
Load 
    RowNo() as Row,
    Id,
    Replace(Mod(RowNo(),4),'0','4') as FormulaA,
    Mod(RowNo()-1,4)+1 as FormulaB,
    Goal
Inline [
    Id, Goal
    1111,1
    1112,2
    1113,3
    1114,4
    1115,1
    1116,2
    1117,3
    1118,4
    1119,1
];

 

 

Output:

clipboard_image_0.png

Blog: WhereClause   Twitter: @treysmithdev
fosterma
Contributor III
Contributor III
Author

Perfect Thanks @treysmithdev