Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
AH
Creator III
Creator III

Change value in the field


Hi,

I would like to force some value in a field to change into something else. This is what i am writing in my script,

if(DataAreaId='tgbr' or DataAreaId ='TGNL','tgnl') as DataAreaId

I want to make the value "tgbr" and "TGNL" to "tgnl". What i am doing wrong in my script?

Thanks,

Shan

1 Solution

Accepted Solutions
maxgro
MVP
MVP

if(match(lower(DataAreaId), 'tgbr', 'tgnl'), 'tgnl', DataAreaId) as DataAreaId

View solution in original post

8 Replies
Anonymous
Not applicable

I guess you want this:

if(DataAreaId='tgbr' or DataAreaId ='TGNL','tgnl', DataAreaId) as DataAreaId

AH
Creator III
Creator III
Author

Hi Michael,

Thanks for your reply. TGNL changed to tgnl but tgbr didnt changed to tgnl.

Thanks,

Shan

maxgro
MVP
MVP

if(match(lower(DataAreaId), 'tgbr', 'tgnl'), 'tgnl', DataAreaId) as DataAreaId

Anonymous
Not applicable

Try this:
if(wildmatch(DataAreaId,'*tgbr*','*TGNL*'), 'tgnl', DataAreaId) as DataAreaId

AH
Creator III
Creator III
Author

Massimo,

I got it fixed. Thank you so much.

Shan

AH
Creator III
Creator III
Author

Massimo,

Oops! Sorry, in the textbox its showing the tgbr is gone. But while i looked at the table i see the tgbr is replaced by     ' - '  hyphen.

Thanks,

Shan

Anonymous
Not applicable

Have you tried the "wildmatch" expression?  If it doesn't help, there is something in the data we can't guess, and need an example of your file...

AH
Creator III
Creator III
Author

Michael,

I am really sorry not to mention it before. I tried with the wildmatch but it didnt work either.

I dont know if anything wrong with the data. I have to check again and i will get back again later.

Thanks for all your replies.

Thanks,

Shan