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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
yelin_nyu
Creator
Creator

limitation of autonumber()/autonumberhash###()

I had to learn it the hard way autonumber isn't always the best way to create system key when you have a complex data model. Such a pain to change hundreds and thousands of lines of code to find out half of your tbl is empty because a couple 'keys' don't recognize each other.

Can someone please give me a bulletin list of the limitation of this function?

What I found is that if I created a key in one table and join that key to another table, and join other data on the second table, 2 separate keys are populated.

main:

load

autonumber(product,attribute) as key

value2,

value3

from main;

left join (main)

load

autonumber(product,attribute) as key,

autonumber(product,location) as prodloc_key,

from translation_tbl;

left join (main)

autonumber(product,location) as prodloc_key

value X

from table2;

I receive nothing from value X, looks like I need to join location to main first and then populate the prodloc key in main or I will get nothing left join from table2.

3 Replies
pgrenier
Partner - Creator III
Partner - Creator III

Hello,

I believe the syntax you are using for your autonumber is incorrect. I propose you try this way:

main:

LOAD autonumber(product & '~' & attribute, 'key') as key,

value2,

value3

from main;

left join (main)

LOAD autonumber(product & '~' & attribute, 'key') as key,

autonumber(product & '~' & location, 'prodloc_key') as prodloc_key,

from translation_tbl;

left join (main)

LOAD autonumber(product & '~' & location, 'prodloc_key') as prodloc_key,

value X

from table2;

The second parameter in the AutoNumber() function is for stipulating a named reference.

Regards,

Philippe

yelin_nyu
Creator
Creator
Author

is this the same for autonumberhash###?

pgrenier
Partner - Creator III
Partner - Creator III

Yes it is