Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How can shorten this expression

I have written following expression using SET where i want the total of quantity based on user selection and if user dont select any country then it should be as select all i am looking forward to shorten this expression

=if(count(GetCurrentSelections(Country)) <>0 , sum({$ <Country = {$(=getcurrentselections(Country,','))}>} Quantity),sum({$ <Country = {'*'}>} Quantity))

Thanks & Regards

Prash

4 Replies
avastani
Partner - Creator III
Partner - Creator III

isn't this redundant? QlikView does what you are asking above naturally based on user clicks. you don't have to specify the selections. just a simple SUM(Quantity) should be fine,

Not applicable
Author

Yes  but i want to add more dimensions such as top 5  Products / country

avastani
Partner - Creator III
Partner - Creator III

Doesn’t matter. That’s QlikView’s in built engine doing it all for you. You can create listboxes and click in it and it will report the associated SUM(Quantity) so you don’t have to worry about loading the expression with set analysis.

In QV 11 you can use the Dimension Limits tab to do the Top(X) analysis,

Thanks.

Amir.

=====================

Amirali Vastani

Tel: 646.773.7936

Not applicable
Author

You can store lengthy expressions in a variable and instead os expression you can call that perticular variable.