Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Partner
Partner

Replacing substring with Some Character

Hi ,

I have a requirement of replacing a String Field Substring.

Example.

Input Row - "AEJGASHDFN2K"

I want Output as - "AExxxxxxxxx2K"

I just want First 2 letters and last 2 letters to be shown ,rest all "X".

NOTE: The length of string would be dynamic. hence cannot set hard coded values.

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Replacing substring with Some Character

Try: left([Input Row], 2) & repeat('x', len([Input Row]) - 4) & right([Input Row], 2)

- Marcus

2 Replies
MVP & Luminary
MVP & Luminary

Re: Replacing substring with Some Character

Try: left([Input Row], 2) & repeat('x', len([Input Row]) - 4) & right([Input Row], 2)

- Marcus

Not applicable

Re: Replacing substring with Some Character

=mid('AEJGASHDFN2K',1,2) & REPEAT('x', len('AEJGASHDFN2K')-4) &

right('AEJGASHDFN2K',2)

Put this in a text box and test.