Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using variables within set analysis

We currently use set analysis to de-select the values on a number of fields. Ex: Sum ({$<[Child Bskt Id]=,[Child Bskt Nm]=>} [Parent Rev]). We also need to force a selection on another field dynamically using a variable. The formula for this would be: Sum ({$(vTestgroup)} [Parent Rev]). We need to figure out a way to combine both formulas into one. We've tried multiple variations of this formula - such as: Sum ({$<[Child Bskt Id]=,[Child Bskt Nm]=>,$(vTestgroup)} [Parent Rev]). Nothing we have tried has worked. Any help on this would be much appreciated.

4 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

The first thing to try is to put the closing angle bracket in the right place:

Sum ({$<[Child Bskt Id]=,[Child Bskt Nm]=,$(vTestgroup)>} [Parent Rev])

If that still does not work, then I suggest you provide more information about what the variable vTestGroup contains. Looking at your example in the post, it looks like vTestGroup contains angle brackets. Remove them and try the expression above.

Hope that helps
Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Thanks for helping us out with this, Jonathan. Moving the angle bracket didn't work either and was actually just a mistake on my part in the post. The variable vTestgroup is actually keyed off of a bookmark. vTestgroup = BM19. BM19 is set using an action button - the end result is always a series of selections on a single field [Location].

Thanks,

Travis

jonathandienst
Partner - Champion III
Partner - Champion III

Travis

To use a bookmark, it goes in the place of the $ sysmbol:

Sum ({BM19<[Child Bskt Id]=,[Child Bskt Nm]=>} [Parent Rev])

So if vTestGroup = BM19, should be:

Sum ({$(vTestGroup)<[Child Bskt Id]=,[Child Bskt Nm]=>} [Parent Rev])

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
tduarte
Partner - Creator II
Partner - Creator II

Travis, that isn't working for me.

I'm using a simple Concat ({$(vBookmark)} field_name) and it doesn't return anything. If I replace $(vBookmark) by the bookmark name then it works fine.

Is there something wrong with the syntax or is it just not possible to use bookmarks inside variables?

Thanks,

Telmo