Qlik Community

QlikView Documents

Documents for QlikView related information.

Scrambling Data

Employee
Employee

Scrambling Data

When creating demo applications, there is often the need to scramble the data so that sensitive information is not available to the users.  The data that needs to be scrambled may include data such as companies, names, addresses, phone numbers, email addresses and/or sales figures.  QlikView provides scrambling functionality where the user can select the field(s) to scramble.  This is convenient if you do not care what the scrambled data looks like.  If you want the data to look realistic then you can consider using mapping and modifiers to scramble the data.  This process takes a little more time but in the end the scrambled data looks realistic.  In this technical brief, an approach to handle scrambling the data will be reviewed.

I have also written a blog on this topic.  Check it out.

Have fun scrambling!

Jennell

Attachments
Comments
datanibbler
Esteemed Contributor

Hi,

good one! Scrambling is indeed a very useful feature when you're dealing with any kind of sensitive data and want users to get the picture, yet avoid distributing that kind of data.

I have to deal with a lot of data that involves names which should be visible only to a few.

Currently what I do is I load those names, but then make the visibility of the resp. column dependent on the logon - or I don't load them to begin with.

Using your approach, however, I could conditionalize the loading_script on the logon instead and just always display that column, but for anyone else (but the few people who are to see names), there would just be Jane_Doe's and Mark_Hamilton's or whatever.

Great post!

thornofcrowns
Valued Contributor II

Nice work, lots of food for thought!

Working with sensistive data, we normally scramble the data at source, using pseudo IDs etc., as well as restricting the views as per DataNibbler's post.

Not applicable

Thanks for the article.

Just to add to this. You can also do this with a macro.

Sub Scramble

ActiveDocument.ScrambleField "field",false

End Sub

Regards,
Marius

Not applicable

Hello,

We created a short video showing "How to reduce and scramble data"

You can watch it here:

100 Second Video - How to Reduce and Scramble a QVW

Best regards

Dirk Scharffetter

Not applicable

Scrambling can be done if you have ADMIN access  or the users who are having user access aswell?

BR,

Avinash

bestofwest
Contributor II

The second method is not secure - multiply  by a value that is a constant.

It's correct something like that:

SELECT .....    value_col * randomJS() from ....

On Edit Script:

function randomJS(){

return Math.random();

}



If You want True Random String create the function randomStringJS and useIt:


function randomCharJS(){

  var n=Math.floor(Math.random()*62);
 
if(n<10) return n;
 
if(n<36) return String.fromCharCode(n+55);
 
return String.fromCharCode(n+61);
 
}


// L - Size of String Field


function randomStringJS(L){

   var s= '';
   while(s.length<L) s+=randomCharJS();
  
return s;
}


mayankraoka
Valued Contributor

Awesome explanation......

devarasu07
Honored Contributor II

Hi,

How to rollback scrambled data into original state? i don't see any options in Document properties. is there anyway to revert back? please advise me on thanks.

Regards,

Deva

mayankraoka
Valued Contributor

Hi Devarasu,

Just reload the application it will rollback your data.

Regards,

Mayank

devarasu07
Honored Contributor II

Ok Thanks

Version history
Revision #:
1 of 1
Last update:
‎03-13-2014 01:41 PM
Updated by:
Employee