Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
!
You should use hash functions. Check :Hash256()
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
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