Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
honeyasha
Contributor III
Contributor III

can any one explain pick and match function

Please explain pick and match function with example and in which scenario we will use this.

5 Replies
Anonymous
Not applicable

Pick

It is a conditional statement that will perform certain action based on the result of the condition.

     Syntax: Pick(condition, exp1, exp2, ....expN)

                   So if condition=1 exp1 will be performed.

                        if condition=2 exp2 will be performed and so on

Match

Match function will compare the string with the expression and returns the number(position) of the expression that matches.

     Syntax: Match(String, exp1,exp2, ... expN)

     Eg: Match(Month, April, July, Dec, Jan, Jun, Feb, Nov, Mar, Oct, May, Sep, Aug)

          Result: if Month = March the result will be 8

                        Month = August the result will be 12 and so on

Anonymous
Not applicable

Hi

Pick: This Function is used On Script level and in front end i.e on chart level .

This function returns the nth expression in the list

Syntax :pick(n, expr1[ , expr2,...exprN])

Example: pick(N,'A','B,9,'D',5) If we specify the Value of N as 2 Then it will return 'B'

if we specify the value of N=3 then it will return 9 .

Match: As the name suggest Match is also an script level as well as front end i.e chart level function

This function is case sensitive and compares the value of first parameter with all the parameters and returns the number of expression that matches.

Syntax: match( str, expr1 [ , expr2,...exprN ])

Example: match(N,'ASIA','EUROPE','MEA','UNITED STATES')

If N= 'ASIA' it will return 1 and

If N='Australia' will return 0 as the string doesnt match .

Thanks

Anonymous
Not applicable

Hi,

pick - script and chart function

The pick function returns the n:th expression in the list.

Syntax:

pick(n, expr1[ , expr2,...exprN])

Arguments:

ArgumentDescription
nn is an integer between 1 and N.
ExampleResult
pick( N, 'A','B',4, 6 )returns 'B' if N = 2

returns 4 if N = 3

match - script and chart function

The match function compares the first parameter with all the following ones and returns the number of the expression that matches. The comparison is case sensitive.

Syntax:

match( str, expr1 [ , expr2,...exprN ])


ExampleResult
match( M, 'Jan','Feb','Mar')

returns 2 if M = Feb.

returns 0 if M = Apr or jan.

ecolomer
Master II
Master II

Hi,

Here you have an example