Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
fbottinelli96
Contributor
Contributor

Predictable Autogenerate

Hey community!
I'm trying to generate an id for my main data table, which is generated based on a unique combination of (id_item)/(id_store)/(id_date)/(id_market)
Anyway, till now I've been using Autogenerate(), but I have had occasional issues with it. (This id is used to eliminate duplicated information, since the table is a concatenate of every day data, and data duplication is a granted). My issue is that the Autogenerate function will not always give me the same id.
Doing some research, I found that Autogenerate is not guaranteed to produce the same result within different reloads. Thats key for me, I need a predictable way to generate a shorter id produced for each of those 4 fields unique combination.
Any ideas on how to stabilize this variable, is welcome. Thank you very much
!

Labels (2)
3 Replies
tresesco
MVP
MVP

You should use hash functions. Check :Hash256() 

marcus_sommer

I think you don't need the autonumber() else a where-clause with exists, maybe something like this:

table:
load *, (id_item)/(id_store)/(id_date)/(id_market) as KEY from Daily;
concatenate(table)
load * from MergedData.qvd (qvd) where not exists(KEY);
store table into MergedData.qvd (qvd);

- Marcus

Brett_Bleess
Former Employee
Former Employee

You have received two posts back regarding your use case, we would appreciate it if you would close out the thread if one of those posts solved your issue by  using the Accept as Solution button on the post that did help.  

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.