Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
In loadscript, I have a function in my table where i want to compare the field "id", to multiple values, if it matches a set of values, have status as 'Live' otherwise, get status from existing status field in table. However, it is only comparing against the first value, 87 and only lists it as Live, while the remaining 4 IDs arent live.
When i load the table and look at id 1403 for example, it still says 'Testing' instead of 'Live' which according to the formula should not be the case
if(match(id, '87','1403','3082','322','518') = 1, 'Live',release_status) as release_status2,
I have also tried with wildmatch and * around the numbers but its the same result where only the row with ID 87 says live and none of the other IDs have teh appropriate release_status2 value
what am i doing wrong here?
Match() returns the index number of the matching element. So given
match(id, '87','1403','3082','322','518')
id = 1403 would return 2. So the problem is with your if test.
match(id, '87','1403','3082','322','518') = 1
would only be true for 87. Instead use
match(id, '87','1403','3082','322','518') > 0
or just
match(id, '87','1403','3082','322','518')
-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com
Match() returns the index number of the matching element. So given
match(id, '87','1403','3082','322','518')
id = 1403 would return 2. So the problem is with your if test.
match(id, '87','1403','3082','322','518') = 1
would only be true for 87. Instead use
match(id, '87','1403','3082','322','518') > 0
or just
match(id, '87','1403','3082','322','518')
-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com
ah, perfect thank you!! I was thinking its a binary response, based on if it matches or not
>0 was able to fix ti , ty!