Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Please explain pick and match function with example and in which scenario we will use this.
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
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
Hi,
The pick function returns the n:th expression in the list.
Syntax:
pick(n, expr1[ , expr2,...exprN])
Arguments:
Argument | Description |
---|---|
n | n is an integer between 1 and N. |
Example | Result |
---|---|
pick( N, 'A','B',4, 6 ) | returns 'B' if N = 2 returns 4 if N = 3 |
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 ])
Example | Result |
---|---|
match( M, 'Jan','Feb','Mar') | returns 2 if M = Feb. returns 0 if M = Apr or jan. |
Hi,
Here you have an example