Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
philmywallet
New Contributor III

Name field encrypt part


I have a name field and I want i to keep the same number of chacters but replace everything with '*' except for the first character.

e.g.

Name = 'Smith'  - Encrypted Name = 'S***'

Name = 'Johnson' - Encrypted name = J******

Is there any script that will do this?

Thanks

Phil

1 Solution

Accepted Solutions

Re: Name field encrypt part

Left(Name,1) & repeat('*', len(Name)-1) as Name


talk is cheap, supply exceeds demand
5 Replies

Re: Name field encrypt part

Left(Name,1) & repeat('*', len(Name)-1) as Name


talk is cheap, supply exceeds demand
philmywallet
New Contributor III

Re: Name field encrypt part

Perfect.

Thanks

Phil

philmywallet
New Contributor III

Re: Name field encrypt part

As a further q is there any way I can put the last character on there aswell

E.g.  J*****n

jsaradhi
Valued Contributor

Re: Name field encrypt part

modify Gysbert's expression to do it:

Left(Name,1) & repeat('*', len(Name)-2) & right(Name,1) as Name

bestofwest
Contributor II

Re: Name field encrypt part

It's better define a maximum size: (in this case 60)

Left(Name,1) & repeat('*', 58) & right(Name,1) as Name

Community Browser