Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I am currently working on a project where I need to hash a certain field with values of usernames. The project is only for internal use. Thus I use the hash128()-function in the script.
Although the usernames need to be hashed, it is also reuqiered to access the unhashed values from time to time. This will be done manually by reloading the app once without the hash-function and then hash the field again.
The challenge is that if I hash the usernames, then unhash them and hash them again, the "second hashed values" are excactly the same as the ones before.
This means for example the username "Mike" will be "XYZ" when hashed the first time, unhashed it will be "Mike" again and then after reloading it with hash(usernames) it is "XYZ" again.
Is there any way to randomise the hash function every time when reloading the app?
I tried hash128(username, rand()) but that doesn't work properly. It leads to random values for every single time "Mike" is part of the data.
Thanks in advance!
I think you are on the right track with rand(), you just need to use something that is unique per script run but constant for the duration of the run. How about
LET vNow = Num(Now());
LOAD
hash128(username, $(vNow)) as Hashed
...
-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com
By design, a hash function can not be reversed.
you could use something that change character with special character and mix it in a reversible way
I think you are on the right track with rand(), you just need to use something that is unique per script run but constant for the duration of the run. How about
LET vNow = Num(Now());
LOAD
hash128(username, $(vNow)) as Hashed
...
-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com
@rwunderlich Thanks a lot - the solution with a separate variable works fine!