Qlik Community

Qlik Sense App Development

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

victor_greffet
New Contributor III

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

Re: Compare string of two columns

Try this.

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

From xyz;

Regards,

Kaushik Solanki

victor_greffet
New Contributor III

Re: Compare string of two columns

Hi Kaushik Solanki,

Thks for your answer

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

sarafamiglietti
Contributor

Re: Compare string of two columns

Hello,

You can use the Wildmatch function

wildmatch ‒ QlikView

-> So in you case

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

Regards

surendraj
Valued Contributor

Re: Compare string of two columns

something like

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

Community Browser