Skip to main content
Announcements
Qlik Launches Open Lakehouse and advanced agentic AI experience in Qlik Answers! | LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Uri
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
Specialist III

Hi @Uri !, please try this :

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

QFabian

View solution in original post

2 Replies
QFabian
Specialist III

Hi @Uri !, please try this :

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

QFabian
Uri
Creator
Author

Hi @QFabian !

It works as expected! 

Thank you!

BR,

Artur