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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Variables in set Analysis

How can I use a variable in a set analysis expression?

10 Replies
Not applicable
Author

Oleg (and everyone)-

This is wonderfully helpful. That being said, how do I set up set analysis (with variables) to sum up specific values contained in the output of the variables?  Here's an example expression:

=sum({<Product.ProdName={'$(vProd1)'}>}

Product.ProdValue) + sum({<Product.ProdName={'$(vProd2)'}>}

Product.ProdValue) + sum({<Product.ProdName={'$(vProd3)'}>}

Product.ProdValue) + sum({<Product.ProdName={'$(vProd4)'}>}

Product.ProdValue)

The above expression works absolutely fine.  I need a totals column. That being said, the values contained in vProd1, vProd2, (so on...) contain either a "ProdA" or "ProdB" contained in the ProductName (which is pulled in based on the variable).  I need to sum up all values containing "ProdA" and sum up all values containing "ProdB" each in it's own column.  What's the best way of accomplishing this?

Also...  I have to imagine this can be highly intensive (or could be).  I've provided a highly shorted version of this expression above.  Additionally, there are always hundreds of Products being added everyday.  So, I don't want to run into an "Out of memory" situation.  So also looking for efficient ways of handling this situation as well.

Thanks!