Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Using Pick and Match for multiple calculations

Hi,

Some time ago I read in a discussion that you can use variables that have pick and match functions to return calculations based on selections, and use this variables inside expressions. For instance:

Set vExpressions = Pick(Match(Calc, 'Orders', 'TotalCustomers'), SUM(Orders), Count(Customers))

If my field Calc has the value Orders, the expression returned will be SUM(Orders), or if Calc field has the value TotalCustomers it will return the expression used to calculate the total of customers.

So, I would like to know if this is a good practice, and how this type of expressions could affect the performance of the application, specially if I'm not working with just to but several (let say 15 or 20) possible selections. 

There are other type of methods that can be used to achieve the same?

I would like to know your opinion.

Regards,

Karla

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

This post gives one opinion: Re: Expressions in Fields

It depends more on the expressions you put in the pick function then the number of expressions I reckon.

I don't know how you use the pick-match and the Calc field. Perhaps you can achieve the same with separate chart expressions that are shown/hidden at need. See these blog posts:


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

This post gives one opinion: Re: Expressions in Fields

It depends more on the expressions you put in the pick function then the number of expressions I reckon.

I don't know how you use the pick-match and the Calc field. Perhaps you can achieve the same with separate chart expressions that are shown/hidden at need. See these blog posts:


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Thank you Gysbert,

According with the post, it doesn't affect too much how many expressions do you have, but the complexity of the each of them.

I'm just curious about how Qlik handle this type of functions. Does it first evaluate the pick-match and then evaluate the expression returned, or evaluates all the expressions inside the pick-match and then return the result.

Regards,