Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Congratulations to the new Qlik Luminary and Partner Ambassador class! Meet them here
cancel
Showing results for 
Search instead for 
Did you mean: 
CasperQlik
Creator
Creator

Hash field after load

Hi Qlik Community

Is it possible to Hash or 'scramble' a field after it is loaded?

Let's say I've loaded my datamodel in the following qvs file: data_model.qvs. 

Can I then hash a field like salery_key with a hash funciton after the model is loaded or do I have to do it when I load the field in the table the first time?

I hope it makes sense.

Casper

Labels (6)
1 Solution

Accepted Solutions
rwunderlich
MVP
MVP

6 Replies
Or
MVP
MVP

As far as I know, there's no scrambling option for QS on the front end (QV has a Scrambling option). You'd need to do this in your script - it doesn't have to be in the original Load statement the field appears in, you can e.g.

Temp:

Load Field1, Field2 From YourTable;

Final:

NoConcatenate Load Field1, autonumberhash256(Field2) as Field2

Resident Temp;

 

Drop Table Temp;

 

But it does have to be in the script since that's when field values are populated.

On the front end, you could scramble the value in a master dimension, but the underlying value would still be available in the app so if this is meant as security it's not a good solution.

CasperQlik
Creator
Creator
Author

I did mean to hash it in the script and not the front end. My query was if I could hash a single field after I loaded the table.

Or
MVP
MVP

You'd need another load pass, I believe. I'm not familiar with any other mechanism to achieve that. As far as I know, there's no concept along the lines of Scramble Field Fieldname; like there is with Drop or Rename.

steeefan
Luminary
Luminary

Agreed, there is no Scrambling functionality in Qlik Sense such as the one in QlikView:

steeefan_0-1705329284355.png

You would have to reload the app and then apply any of the Hash functions:

NOCONCATENATE LOAD
  Hash128(FieldName) AS FieldName,
  ...
RESIDENT
  Table;

If you cannot reload the app, you could still load it BINARY and then perform the scrambling actions.

rwunderlich
MVP
MVP

At the end of your script, use the AutoNumber statement on the field(s) you want to obfuscate:

Autonumber Myfield1;

https://help.qlik.com/en-US/sense/November2023/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptRegu...

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

CasperQlik
Creator
Creator
Author

Thank you Rob.

That was the exact functionality I was looking for.