Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis with a variable in the filters (possible?)

Dears, I would like to do a set analysis using variables, but the variable would be the filter of the formula, for example:

This is the normal

=Sum({$<PRODUCT_FAMILY={"Family"}>}($(vInvoice))


I want to use the variable in the <  > (in the place of PRODUCT_FAMILY)


How do I do that?

1 Solution

Accepted Solutions
gmoraleswit
Partner - Creator II
Partner - Creator II

8 Replies
sudeepkm
Specialist III
Specialist III

EDIT:

surprising I added the variable inside but it didn't show up

=Sum({$<PRODUCT_FAMILY={"$(vInvoice)"}>}Sales)


=Sum({$<PRODUCT_FAMILY={""}>}Sales)

Not applicable
Author

I would like to place the variable vInvoice inside the < >, instead of PRODUCT_FAMILY

but it is not working properly. How do I do that?

Not applicable
Author

???

and how would it be using the PRODUCT_FAMILY?

alexandros17
Partner - Champion III
Partner - Champion III

Unfortunately no ...

gmoraleswit
Partner - Creator II
Partner - Creator II

Declare a variable with the value : PRODUCT_FAMILY={"Family"}

Use it in your expression:

=Sum({$<$(vVar)>}($(vInvoice))


You can also use multiple variables:


=Sum({$<$(vVar),$(vVar2)>}($(vInvoice))


Not applicable
Author

Have you tested it?

gmoraleswit
Partner - Creator II
Partner - Creator II

Yes, see attach

sudeepkm
Specialist III
Specialist III

I'm sorry I thought you are asking to have a field value taken from a variable.

but please take a look at the example.

I've declared a variable as Field name and used that in set analysis. I thought it would not work.

aa.png