Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
jessica_webb
Creator III
Creator III

Calculated variable in expression with set analysis

Hi,

I have a variable in my script:

Let vValue = 'Avg((Points-Target)/Difference)';

What I would like to do, is use this in an expression with set analysis. For example:

=ONLY({<Type={'A'}>} $(vValue))

But this just gives me a '-' null value.

If I just put =$(vValue) and then select 'A' from a filter for Type, it works fine. So why can't I do this within my expression?

I need to keep my 'A' dimension within the expression, as I plan on using several expressions within the chart, with the appropriate dimension coming from a different field each time.

Any help appreciated.

Thanks,
Jess

13 Replies
jessica_webb
Creator III
Creator III
Author

That is exactly it!

Thank you so much Marcus, really appreciate your help with this!

Best wishes,

Jess

Not applicable

How would the code look if you want to use two dimensions in this set analysis?

jessica_webb
Creator III
Creator III
Author

Hi Laura,

I added another dimension as follows:

=ONLY({<Type={'A'}, Dim2={'X'}>} aggr($(vValue), Type,Dim2))


With Dim2 being my second dimension and that worked just fine.

Not applicable

Thanks a lot for your fast respond, it works!