Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have an ID field in my qlikview document that is considered personal/sensitive data that cannot be shown to other users. I am creating a report that needs to be grouped by this field, so i want to create a secondary ID field, based on the unique values in the original ID field, so that this new ID can be used on the report and sent to users.
Any ideas? I tried autonumber(Orginial ID) and it froze my entire qlikview instance.
How much data do you have? Another approach would be to use Peek/Previous to create a unique ID
Table:
LOAD [Original ID],
....
FROM ...;
FinalTable:
LOAD *,
If([Original ID] = Previous([Original ID]), Peek('UniqueID'), RangeSum(Peek('UniqueID'), 1)) as UniqueID
Resident Table
Order By [Original ID];
DROP Table Table;
How much data do you have? Another approach would be to use Peek/Previous to create a unique ID
Table:
LOAD [Original ID],
....
FROM ...;
FinalTable:
LOAD *,
If([Original ID] = Previous([Original ID]), Peek('UniqueID'), RangeSum(Peek('UniqueID'), 1)) as UniqueID
Resident Table
Order By [Original ID];
DROP Table Table;
Hi,
If the above does not work... how about using RowNo() when loading the data to give the row a Unique ID...
if needed, you can import the distinct version of your ID with the row number and then use table joins to move the Row Number ID around to other tables in QlikView
JOIN (Data)
LOAD
*
RESIDENT UniqueIDs;
and then drop the field\tables once finished.
This probably means the Row ID to your UNID changes with every data load
This worked! Thank you so much. One last question, will these IDs change every time we reload the document?
They might change based on different the order of [Original ID]
Hi
Directory;
Final:
LOAD Id,
Amount
FROM
Table;
Final_Data:
LOAD *,
If([Id]=Previous([Id]),Peek('UniqueID'),RangeSum(Peek('UniqueID'),1)) as UniqueID
Resident Final