Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Does autonumberhash256 create UNIQUE values based on its composing fields?

Hi,

Does anybody know if the autonumberhash256 function returns unique values for the same input fields? Its the definition of hashing, I know, but I seem to get sequential values!

I use it somewhat like this:

I have two tables (one for BUDGET and one for SALES) I store in two qvd, and before I store them I create this concatenated PK in both tables (this is done in different qvw):

autonumberhash256(MONTH_ID, STORE_ID, SUPPLIER_ID, BRAND_TYPE, CATEGORY_ID)as PK_BUDG


When I load them in another qvw I need to find out what exists in one table that doesn't exist in the other:



Budget_Temp:
LOAD PK_BUDG,
MONTH_ID,
STORE_ID,
SUPPLIER_ID,
BRAND_TYPE,
CATEGORY_ID
FROM $(srcFile_Budgets) (qvd)
WHERE NOT EXISTS (PK_BUDG); //everything that has budget but not sales




This fetches 0 lines (vs not using autonumberhash256() and just concatenating the fields for the PK, which fetched about 5M rows). What happens is: the SALES table has two years of sales and the PK begins in 2008-01 whilst the BUDGET table has only 1 year and the PK begins in 2009-01. I've peeked the first lines of each table stored to qvd and I reallized the PK seems sequential (beginning in 1, 2, 3,...(...) for 2008-01 in sales qvd and beginning in 1, 2, 3,...(...) for 2009-01 in budget qvd).

The sales table has about 130 million rows and the budget table has about 12 million rows so thats why it makes a huge difference when I use the autonumberhash!

Anyone has any ideas why this happens? Shouldn't I get an unique value instead of a sequential one? I've searched the forum and got nothing about this.

Thanks in advance,

Marina Carvalho

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

I already got feedback on this and it seems that the returned value will always be sequential unless the loading of the two tables is in the same qvw.

View solution in original post

1 Reply
Not applicable
Author

Hi,

I already got feedback on this and it seems that the returned value will always be sequential unless the loading of the two tables is in the same qvw.