Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
nikhilgarg
Specialist II
Specialist II

Sorting

HEy,

In my attached app, i want my dimensions as:

1 a

2 a

3 a

4 a

5 a

1 b

2 b

3 b.

How can i acheive this?

4 Replies
MK_QSL
MVP
MVP

add this in your script

AutoNumber(RowNo(),Grp) as ID

nikhilgarg
Specialist II
Specialist II
Author

Hey,

Thanks it works but can you plz explain how AutoNumber(RowNo(),Grp) works?

fkeuroglian
Partner - Master
Partner - Master

Hi

When there is need for Unique numbers in the table or data model See the example from the help

autonumber(expression[ , AutoID])

Returns a unique integer value for each distinct evaluated value of expression encountered during the script execution. This function can be used e.g. for creating a compact memory representation of a complex key.

In order to create multiple counter instances if the autonumber function is used on different keys within the script, an optional parameter AutoID can be used for naming each counter.

Examples:

autonumber( Region&Year&Month )

autonumber( Region&Year&Month, 'Ctr1' )

nikhilgarg
Specialist II
Specialist II
Author

Hey,

Thanks i understand the use of autonumber() that it creates the unique value for combinations.

But here autonumber for following are:,

100 a , 100 b  as 1 , 200 a, 200 b as 2, 300 a, 300 b as 3 and so on

But , what i want to know is how it is working that my output is coming like:

100 a

200 a

300 a

100 b

200 b

300 b