Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Uri
Creator
Creator

LEFT WITH TRIM AND IF STATEMENT

Hi!

I have 2 fields: price and phn_num.

In phn_num field I want to display following:

If price is 0 then I want last three digits of phn_num to be replaced with XXX. 

BR,

Artur

Labels (1)
1 Solution

Accepted Solutions
QFabian
MVP
MVP

Hi @Uri !, please try this :

if(price=0, mid(phn_num,1, len(phn_num)-3) & 'XXX', phn_num)

Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.

View solution in original post

2 Replies
QFabian
MVP
MVP

Hi @Uri !, please try this :

if(price=0, mid(phn_num,1, len(phn_num)-3) & 'XXX', phn_num)

Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.
Uri
Creator
Creator
Author

Hi @QFabian !

It works as expected! 

Thank you!

BR,

Artur