Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
manoranjan_321988
New Contributor

Pick match function

Will Pick will evalute the expression example

 

decalred a variable

vMatch 

=pick(match(PeriodID, '5',), $(=$(vMaxYear))

And calling the variable in text as Vmatch its not working. please suggest.

Labels (1)
3 Replies
dapostolopoylos
Contributor III

Re: Pick match function

Match function returns -1 (TRUE) and 0 (FALSE)...

I haven't understood what you want to do, can you provide a sample app with some sample data to play around? 

Father/Husband/BI Developer
Partner
Partner

Re: Pick match function

For pick / match combination to be useful, you'd need more than one option, else you do a simple if and have the same result

 

Not quite clear what you need by what you wrote, but a use would be like so (adding on your code)

=pick

(

   match

   (

      PeriodID,

      1,

      2,

      3,

      4

   ),

   $(=$(vMaxYear),

   $(=$(only(Whatever)),

   $(=$(sum(Whatever)),

   $(=$(avg(Whatever))

)

 

That would select the expanded expression out of the possible values, according to the matched PeriodId.

Partner
Partner

Re: Pick match function

Match will return the number of the value that is matched. So Match('hi','bye','d','hi') Will return 3. If no Match is found it will return 0. Pick will use that number starting by 1 to give a result. If u use +1 you can let these pick results to start with a default value for when the match returns a 0.

Your example is missing some ')'