Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone, |
today, Im having simple problem that is driving me crazy!
All I want to do is to evaluate if supplyed text matches an expression and then do something:
Let maskedCount = 1;
LET name = 'BRR_wrwq';
if Match($(name), '*BRR_*') then
let maskedCount = $(maskedCount) + 1;
ENDIF
I have tried all of if and *Match functions in perhaps all combinations possible but its doing just what it wants 😕
In this particular case Im referring to wildmatch function
It still skips the let statement and if I add <>0 it allways enters it
Im using QlikView 11 SR1 64bit
Thank for your responses!
Hi
This should work:
Let name = 'BRR_wrwq';
If WildMatch('$(name)', '*BRR_*') then
Let maskedCount = maskedCount + 1;
End If
or
Let name = 'BRR_wrwq';
Let maskedCount = maskedCount + If(WildMatch('$(name)', '*BRR_*'), 1, 0);
HTH
Jonathan
Hi
This should work:
Let name = 'BRR_wrwq';
If WildMatch('$(name)', '*BRR_*') then
Let maskedCount = maskedCount + 1;
End If
or
Let name = 'BRR_wrwq';
Let maskedCount = maskedCount + If(WildMatch('$(name)', '*BRR_*'), 1, 0);
HTH
Jonathan
You need to enclose the variable in apostrophes, and use 'wildmatch'
...if wildmatch('$(name)','*BRR_*') then ...
both you solutions are working, thank you very much!
Mystery solved!