Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have the following table in script:
ACCT_ID | BINARY |
---|---|
0005474140 | 10010 |
0007249214 | 00011 |
0008583998 | 10010 |
0008735138 | 10101 |
0010553272 | 11100 |
What I need is to generate a new field ID with a unique number for the BINARY field like this:
ACCT_ID | BINARY | ID |
---|---|---|
0005474140 | 10010 | 1 |
0007249214 | 00011 | 2 |
0008583998 | 10010 | 1 |
0008735138 | 10101 | 3 |
0010553272 | 11100 | 4 |
I could have repeated numbers in BINARY, so the generated number in ID should considerate this possibility.
Do you know if there's any way to do this?
Thank you!
You could use autonumber() for this
EX:
LOAD ACCT_ID,
BINARY,
AutoNumber(BINARY) as Key
FROM
[http://community.qlik.com/thread/151513]
(html, codepage is 1252, embedded labels, table is @1);
Result:
You should use the command
AutoNumber in the script:
AutoNumber( BINARY) as ID
You could use autonumber() for this
EX:
LOAD ACCT_ID,
BINARY,
AutoNumber(BINARY) as Key
FROM
[http://community.qlik.com/thread/151513]
(html, codepage is 1252, embedded labels, table is @1);
Result: