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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

if Expression

Hi All, 

I have a below column in my DB which looks like the below screenshot. I want to remove 'Mode0' and also want to rename 

'NoMode's as 'No Mod'  to achive this i am trying to use this expression  

=if(not Match(LABEL,'Mode0'),LABEL) and if(LABEL='NoModes','No mode',LABEL) but this is not working can anyone please help me on this 

smilingjohn_0-1660885379369.png

Thanks in Advance

Labels (4)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master II
Partner - Master II

I believe that's the expected output

IF(WildMatch(LABEL,'*Mode0*'),NULL(),
IF(WildMatch(LABEL,'*NoModes*'),'No mode',LABEL)) AS LABEL

peter_brown_0-1660887592791.png

 

View solution in original post

3 Replies
Lakshminarayanan_J
Creator
Creator

@smilingjohn 

Please fine the below script and screenshot for your reference.

Script:

Test:
Load * Inline
[
ID,Sales
1,Mode0
2,Mode1
3,Mode2
5,NoMode
];

Test1:
NoConcatenate
Load
ID,
Sales,
IF(Sales<>'Mode0',Sales)as sales1
Resident Test;
drop Table Test;

Lakshminarayanan_J_0-1660886992064.png

Expression:

=if(sales1='NoMode','No Mode',sales1)

 

Lakshminarayanan J
To help users find verified answers, please don't forget to use the "Accept as Solution" button
BrunPierre
Partner - Master II
Partner - Master II

I believe that's the expected output

IF(WildMatch(LABEL,'*Mode0*'),NULL(),
IF(WildMatch(LABEL,'*NoModes*'),'No mode',LABEL)) AS LABEL

peter_brown_0-1660887592791.png

 

BrunPierre
Partner - Master II
Partner - Master II

@smilingjohn Is your question answered, please mark as such.