Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

QV If a certain text exists in chart table, display as text

Hi,

Please assist

I have a string of text that if it contains the word XYZ, need to display as ABC in a Chart Table

Please assist

Regards

Marcus

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

sorry.. it should be the other way round,

Load

replace(yourfield,'xyz','abc')  as yourfield ,

//

View solution in original post

6 Replies
Anonymous
Not applicable
Author

Hi

if(namefield=XYZ,ABC)

buzzy996
Master II
Master II

try this,

=If(FieldName='XYZ','ABC',FieldName)


Anonymous
Not applicable
Author

Did you mean like this,

Load

replace(yourfield,'abc','xyz')  as yourfield ,

//

Anonymous
Not applicable
Author

sorry.. it should be the other way round,

Load

replace(yourfield,'xyz','abc')  as yourfield ,

//

Not applicable
Author

Thank you very much - worked like a charm

Could I please ask you a further question, Should I wish to replace any fields that contain XY* with ABC, how would I do this?

Thanks

Anonymous
Not applicable
Author

Like this?

Load

F1 as from,

if(len(mid(F1,index(F1,'xy')))>2,mid(F1,1,(index(F1,'xy')-1))&'abc'&mid(F1,index(F1,'xy')+3),F1) as to

;

LOAD * INLINE [

    F1

    hi xyz

    hello xy

    xyz

    xyt qweqw

];

Thanks,