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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
cbaqir
Specialist II
Specialist II

If(Match) not working correctly

I am trying to use this as a dimension but I am getting some duplicates where it shows both Project and Non-Project and not sure why:

=if(match(COM_CAT,'ERC - Project'),'Project','Non-Project') 

I also tried is in the script but same issue:   if(wildMatch("COMMITTEE_CAT",'ERC - Project')>0,'Project','Non-Project') as PROJECT

For this ticket, I would only expect Project since it did hit the ERC - Project status.

2018-09-25_8-12-23.jpg

10 Replies
captain89
Creator
Creator

Hi,

I think that you should trim your field:

try this:

map_project:

mapping LOAD Committee_Cat, Project INLINE [

    Committee_Cat, Project

    ERC - Project, Project

];

yourtable:

load*,

ApplyMap('map_project', text(trim(COMMITTEE_CAT)), 'Non-Project') as PROJECT 

resident yourtablew;

drop table yourtablew;

Also you can use wildmatch with * at the end:

if(wildMatch("COMMITTEE_CAT",'ERC - Project*')>0,'Project','Non-Project') as PROJECT


or if(trim(COMMITTEE_CAT)='ERC - Project', 'Project', 'Non-Project') as Project