Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
QlikWorld online is next week! REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
victor_greffet
Partner
Partner

Compare string of two columns

Hi community,

I'd like to flag if the string of one column appear in an other column and count them in KPI, something like that (in the visual mode)

IDDepartmentADepartmentBflag

1

AinxxxxAinxxxok
2

Cantal

xxxxxxxxxxxnok
3Garonnexxxxxxxxxxnok
4AveyronxxxxAveyronok
5
...

I tried :

-->   If(WildMatch(DepartmentA,'*'&DepartmentB&'*'),'Ok','nOK') as Flag

-->  If(Substringcount(DepartmentA,'*'&DepartmentB&'*')<>1,'Ok','nOK') as Flag

-->   If(WildMatch('*'&DepartmentA&'*',DepartmentB),'Ok','nOK') as Flag

-->  If(Substringcount('*'&DepartmentA&'*',DepartmentB)<>1,'Ok','nOK') as Flag

-->   If(WildMatch('*'&DepartmentA&'*','*'&DepartmentB&'*'),'Ok','nOK') as Flag

-->  If(Substringcount('*'&DepartmentA&'*','*'&DepartmentB&'*')<>1,'Ok','nOK') as Flag

Without success...

Do you have an idea ?

Thanks !

4 Replies
kaushiknsolanki

Try this.

Load *,If(Substringcount(DepartmentB,DepartmentA)=1,'Ok','nOK') as FLag

From xyz;

Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".
victor_greffet
Partner
Partner
Author

Hi Kaushik Solanki,

Thks for your answer

unfo with your formula the Flag ok appear only if DepartmentB=DepartmentA....

sarafamiglietti
Creator
Creator

Hello,

You can use the Wildmatch function

wildmatch ‒ QlikView

-> So in you case

if(WildMatch(DepartmentB, '*'&DepartmentA&'*'),'OK','NOK')

Regards

surendraj
Specialist
Specialist

something like

if(Match(DepartmentA,'*DepartmentB*','OK')