Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Announcement: We have made updates to resolve a Page Not Found error. If you still get this error, please let us know in the Community Corner.
Not applicable

Assign sequential number (001, 002, 003) for each unique name field?


Hi,

   I have a name field  COM_NM  .To each distinct COM_NM we need to assign sequential numbers --001,002,.......till the count of distinct COM_NM.

Can anybody give me exp:

Thanks

Tags (1)
25 Replies

Re: Assign sequential number (001, 002, 003) for each unique name field?

In the script, try this:

AutoNumber(COM_NM) as SEQ_NUM

Not applicable

Re: Assign sequential number (001, 002, 003) for each unique name field?

nope

MVP
MVP

Re: Assign sequential number (001, 002, 003) for each unique name field?

How about:

Test:

LOAD DISTINCT

  Num( AutoNumber( COM_NM , 'COM_NMs' ) , '000' ) AS COM_NMs

RESIDENT

  SomeSourceTable

ORDER BY

  COM_NM;

Highlighted
Employee
Employee

Re: Assign sequential number (001, 002, 003) for each unique name field?

Or ...

Load Distinct

   Recno()  as Sequential,

    COM_NM

Resdent SomeTable;

MVP & Luminary
MVP & Luminary

Re: Assign sequential number (001, 002, 003) for each unique name field?

What kind of reply is "nope"? Do you mean it gives an incorrect result, throws a script error, what?

-Rob

Not applicable

Re: Assign sequential number (001, 002, 003) for each unique name field?

‌hi petter ,

   Ur script is working but still has some problem .

i Will find it out and let u know . Thank u for script

Not applicable

Re: Assign sequential number (001, 002, 003) for each unique name field?

HI Petter,

   It is giving sequential numbers to all rows not to unique name.

Could any one tell for unique COM_NM

Re: Assign sequential number (001, 002, 003) for each unique name field?

Petter's script should give you unique number for each distinct COM_NM. Would you mind sharing a sample???

Not applicable

Re: Assign sequential number (001, 002, 003) for each unique name field?

It gives me sequential numbers for all COM_NM ,but not unique ...(sharing is not possible) ....

IF  COM_NM  is njjhuihjhbhjbhj,,,,it is repeated  35 times  it gives me 001 to 035  number but not

001 for all..

Any help is appreciated