Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
May 18th 10AM ET, Live Chat, bring your QlikView questions. REGISTER
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
Partner

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

Unfortunately no ...

gmoraleswit
Partner
Partner

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
Partner

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