Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
cbaqir
Specialist
Specialist

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
stigchel
Partner
Partner

Maybe use a mapping load for ID where COM_CAT='ERC - Project' and an applymap('YourMap',ID,'Non-Project') as Project

stigchel
Partner
Partner

Something like

Project:

Mapping load DEFECT_ID,'Project' as To From Source where COMMITTEE_CAT='ERC - Project'

Load DEFECT_ID,Applymap('Project', DEFECT_ID,'Non-Project') as Project from Source

joseph_eftamand
Partner
Partner

Do you have to use match?

Since there is only one string in your condition you could just do

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

perhaps you need to use trim(COM_CAT) there may be empty spaces around the text string.

Joseph

vishsaggi
Champion III
Champion III

May be try like

=if( COMMITTEE_CAT = 'ERC - Project' , 'Project', 'Non-Project')

cbaqir
Specialist
Specialist
Author

I used an alias for COMMITTEE_CAT called COM_CAT

cbaqir
Specialist
Specialist
Author

That's what I tried originally but it didn't work either.

vishsaggi
Champion III
Champion III

Are you using this in expression or in the script. Can you share some sample file to look into?

manoj217
Creator III
Creator III

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

joseph_eftamand
Partner
Partner

‘I used an alias for COMMITTEE_CAT called COM_CAT’

Are you implementing the conditional statement in the same load statement as the alias is being created? In that case you would have to use the original name as the Alias is not applied in the load statement, or use a preload statement.

Joseph Eftamandilos | Consultant

DDI +353 1 272 7706 |Main +353 1 272 7700 Ext. 7706

joseph.eftamandilos@capventis.com<mailto:joseph.eftamandilos@capventis.com> | www.capventis.com<http://www.capventis.com/>

IRL: Building 4, Cherrywood Business Park, Dublin, D18 K7W4, Ireland

UK: 3rd Floor, 26 Finsbury Square, London EC2A 1DS, United Kingdom

<http://www.linkedin.com/company/capventis>[cid:image002.png@01CFABE5.57F50690]<https://twitter.com/capventis>