Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

what is pick function where to we use ?

what is pick function where to we use ?

thanks advance

1 Solution

Accepted Solutions
Not applicable
Author

You can use PICK function any where (script or UI) in qvw.

Generally You can use where the expressions changes automatically on user selections.

Simple case: The user requested and needs show only one expression in the chart either Order Value or No of Orders and users can switch between on any one what he needs.

for the above requirement, create a Variable and create the Input and enter the predefined the values.

Let vExpression= { Order Value , No of Orders }

Expression:  PICK( Match('$(vExpression)','Order Value','No of Orders') , SUM(ORDER_AMOUNT) , COUNT(ORDER_ID))

View solution in original post

6 Replies
iktrayanov
Creator III
Creator III

QlikView Help:

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

Returns the n:th expression in the list. n is an integer between 1 and N.

Example:

pick( N'A''B'4, , , )

returns 'B' if N = 2

returns 4 if N = 3

Sokkorn
Master
Master

Hi Manoj,

I would suggestion you to use help file in QlikView or try your best to find in community. There are lots of topic talking about this.

Rgds,

Sokkorn

chiru_thota
Specialist
Specialist

Below video may be helpful to understand pick function completely

Pick Function in QlikView - YouTube

Not applicable
Author

You can use PICK function any where (script or UI) in qvw.

Generally You can use where the expressions changes automatically on user selections.

Simple case: The user requested and needs show only one expression in the chart either Order Value or No of Orders and users can switch between on any one what he needs.

for the above requirement, create a Variable and create the Input and enter the predefined the values.

Let vExpression= { Order Value , No of Orders }

Expression:  PICK( Match('$(vExpression)','Order Value','No of Orders') , SUM(ORDER_AMOUNT) , COUNT(ORDER_ID))

Not applicable
Author

Hi Manoj,

i have used pick function in charts-----suppose different colors for different dimension values.

for example-expression--->backgroundcolor---->pick(match(country,'india','usa','uk'),red(),blue(),green()).

regards

Mahesh T

Not applicable
Author

As far I have studied from Qlikview Developers 11 book, Pick function is an alternative to the If(then_condition,

else_condition). If() is very memory intensive and nested if() can consume heavy resources, it should be avoided and instead Pick function should be used. Below is the explanation from the Book:

The parameters this function takes are:

Pick(n, expr1, expr2)

Where n is an integer number that determines which of the subsequent expressions

should be evaluated. expr1 is an expression to be evaluated when n= 1 and expr2 is

an expression to be evaluated when n= 2

The same result of the Pick function can be accomplished using a nested If;

for example:

If (n = 1, expr1, If(n = 2, expr2))

However, we can easily see that the Pick function is much simpler to use in this case

and can even be lighter in terms of resource usage.

For more details you can lookup the Qlikview for Developers 11 book.

Hope this helped.