Qlik Community

Qlik Sense Enterprise Documents

Documents for Qlik Sense related information.

Scramble Data

Employee
Employee

Scramble Data

Qlik Sense does not have a native data scrambling function. The below script can be used to scramble specified fields. Data values are scrambled with Hash256 function, which is a non-reversible conversion of values to unreadable content. This could be useful for making customer data anonymous before

Before applying to your app, please notice some limitations.

  • Table and field names are case sensitive
  • This solution does not support scrambling of key fields
  • Scrambles values into alphanumeric values
  • Should not be used for numeric fields
  • ~100 characters max length for value to be scrambled

See attached QVF file (Scramble Data.qvf) for basic example on usage.

Generate list of fields through Qlik Sense...

  1. Open app with data to be scrambled
  2. Add new table to expose available fields in data model
    1. Dimension = $Table
    2. Dimension = $Field
  3. Clear selections
  4. Select the fields you want to scramble
  5. Right click table and export data (as Excel file)
  6. Select and copy tables and fields in exported Excel file

  7. Paste values in TAB separated Inline table in script
  8. Reload app to scramble fields
Attachments
Comments
MVP
MVP

Qlik Sense does have a native scramble function but it is (for what reason) not reachable by the client. Here you can download and build an extension to scramble your fields exactly like in QlikView while keeping the pattern of the field values:

https://github.com/q2g/q2g-ext-scramble

teaser

makkenas
New Contributor

HI Ralf Becher,

i am trying to use above extension in qliksense june 2017 patch2

actions i did:

1. save the unzipped file into extensions and import into qmc but still im getting error like below.

Would you please suggest what i missed to use this extension.

Thanks in advance for your support.Screenshot.jpg

Regards,

Sriniscramble error.JPG

thkarner
Contributor III

I think there could be an issue with the used JOIN and would suggest to replace with following code:

LEFT JOIN ('$(vTableName)')
LOAD
   FieldValue AS [$(vFieldName)_old], //Join key
    ScrambledValue AS [$(vFieldName)]
Resident ScrambledValues
WHERE TableName='$(vTableName)'
 

AND FieldName='$(vFieldName)';

thkarner
Contributor III

I see a further potential issue.

Scrambling data (as I understood) should only encrypt data, but should keep the distinct values.

I´ve seen that you´re using Hash256() which creates a UNIQUE 43-character string.

But afterwards this string is cut to the original length, which could probably produce 2 values get merged to the same value. No issue for scrambling data for a demo app. But if you want to provide analysis on data which should be anonymised you could get wrong results.

Do you have same understanding?

Version history
Revision #:
1 of 1
Last update:
‎11-16-2017 12:50 AM
Updated by:
Employee