Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
elfi83
Partner - Contributor
Partner - Contributor

Aggregate for a variable

Hi everyone, 

I'm new to Qlik, I tried to google for a suitable solution but I didn't find anything.

I have created two variables:

v_test1 = having inside 2 dimensions (Industry, Client)

v_test2 = having inside some predefined numbers (e.g. 1000, 100000)

I want to build a filter with the following formula. My idea is to allow the final user to select in the above variables what he wants to aggregate the data for and the lower limit for the value.

=if(num(aggr(sum(Value),v_test1))>num(v_test2),'Y','N')

This formula doesn't seem to work, because the aggr function do not recognize v_test1, anyone can help? Thanks!

Labels (5)
1 Solution

Accepted Solutions
lorenzoconforti
Specialist II
Specialist II

Can you post what is the exact content of the two variables? 

Also, try this:

=if(num(aggr(sum(Value),$(v_test1)))>num($(v_test2)),'Y','N')

 

View solution in original post

3 Replies
lorenzoconforti
Specialist II
Specialist II

Can you post what is the exact content of the two variables? 

Also, try this:

=if(num(aggr(sum(Value),$(v_test1)))>num($(v_test2)),'Y','N')

 

elfi83
Partner - Contributor
Partner - Contributor
Author

Thanks Lorenzo for your help, It seems to work.

Would you mind to provide a brief explanation of the $ function in this case? 

Thanks!

lorenzoconforti
Specialist II
Specialist II

It's called dollar sign expansion; it returns the value of the variable rather than its name

See here:

https://help.qlik.com/en-US/sense/November2019/Subsystems/Hub/Content/Sense_Hub/Scripting/dollar-sig...