Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
manoranjan_321988
Contributor
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
Creator III
Creator III

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
felipedl
Partner - Specialist III
Partner - Specialist III

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.

bramkn
Partner - Specialist
Partner - Specialist

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 ')'