Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On Demand Webinar: See Why Thousands of QlikView Users Have Switched to Qlik Sense. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
BaNANA
Contributor
Contributor

Finding a string as a substring of another

Hi, I have a data set like

Part_Number            Market_Part_Number

         ABC                                  AB

        BCDE                                BCD

I want to make sure that Market Part Number is always substring of Part_Number, If not I have to flag it out as bad data.

Can someone please help me how to do it in Qlik Script side or Expression?

2 Solutions

Accepted Solutions
Kush
MVP
MVP

something like below

 

Map_part:
mapping LOAD *,'_Good_' as Flag Inline [
market_part
AB
BCD
FG ];

Data:
LOAD *,
if(not wildmatch(MapSubString('Map_part',part),'*_Good_*'),'Bad Part') as MapPartFlag
 Inline [
part,market_part
ABC,AB
BCDE,BCD
ACD,FG ];

 

Capture.JPG

View solution in original post

rwunderlich
MVP & Luminary
MVP & Luminary

3 Replies
Kush
MVP
MVP

something like below

 

Map_part:
mapping LOAD *,'_Good_' as Flag Inline [
market_part
AB
BCD
FG ];

Data:
LOAD *,
if(not wildmatch(MapSubString('Map_part',part),'*_Good_*'),'Bad Part') as MapPartFlag
 Inline [
part,market_part
ABC,AB
BCDE,BCD
ACD,FG ];

 

Capture.JPG

View solution in original post

rwunderlich
MVP & Luminary
MVP & Luminary

BaNANA
Contributor
Contributor

This worked! Thank you for the quick answers!