Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor II
Contributor II

Data masking

Hello

I would like to mask some data in sheets (instead of 123456789, display ******789).

The corresponding fields are used as dimension in graphs.

The data reduction hides completely the field, so it doesn't meet the needs.

And I'm currently testing the autonumberhash256() function which returns an unique value for each distinct input.

Does anyone have another idea?

Thanks!

8 Replies
Master II
Master II

Hi,

Currently we have in build data scrambling feature in qlikview but i'm not sure in qlik sense but you can try below alternative method to achieve it.

Scrambling Data

Scrambling Data

Hope this helps you

Regards,

Deva

MVP & Luminary
MVP & Luminary

Can you just do something like:

'*********' & right(myfield,3) as MaskedField

in the script?

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

Contributor II
Contributor II

It doesn't meet the needs in my opinion, because it could produce the same output for 2 different inputs. And scrambled fileds are used as dimension of graphs.

Thanks

Contributor II
Contributor II

Thank you.

What is the best solution:

- using Mapping?

- or a hash function?

I need to scramble phone number, so I'm testing autonumberhash256() function, instead of hash() function.

It should returns a unique integer value for each distinct hash value encountered during the script execution, according to Qlik documentation.

Can you confirm that given the same input, they will always produced a same unique output?

Partner
Partner

would sthing like this work ?

load * , '**'&Replace(AutoNumber (left(field,6)),field,'*')&'***'&Right(field,3) as MaskedField;

load * Inline [

field

123456789

115356789

113566779

11348569

11348569548698

];

Capture.PNG

Or you can even do as follow :

Capture.PNG

=>

the field will contain new values :

Capture.PNG

Contributor II
Contributor II

I'm currently testing something like this:

'#####' & AutoNumberHash256(calling_phone_number)) as calling_phone_number

'#####' & AutoNumberHash256(called_phone_number)) as called_phone_number

It seems working, but to be confirmed.

I want to be sure that for a same input, it will always produced a same unique output:

- 123456789 -> #####1235

- 987654321 -> #####3256

- 123456789 -> #####1235

Partner
Partner

But that won't keep the last 3 numbers; try out my solution, maybe you'll like it

MVP & Luminary
MVP & Luminary

There is no need to use the HashFunction. You can just use

AutoNumber()

and yes, you will be guaranteed a distinct value, within the same script run.

-Rob