Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
juan_patrick
Creator
Creator

GetSelectedcount and Set Analysis

Hi!

I have the expression:

IF(GetSelectedCount(date)=0,

     Sum({<consecutive= { $(=MAX(consecutive)-1)} >} field1),

     (Sum(field1))

)

I have dates, and the rule is:

if there is no one selected, sum field1 by the max date

if there one or more than one date selected, sum field1 by that dates.

The code ots ok with the rule, but, its slos, and i think if I can do it all in set analysis will be faster than now.

Thanks!!

1 Solution

Accepted Solutions
juan_patrick
Creator
Creator
Author

Thank you for the answers!

I have solved it! But i didnt say thats it was in qlik sense....

I create a variable:

=if(GetSelectedCount(date) = 0, '$(=Max(consecutive))', concat(distinct consecutive,','))

And in the expression I call it:

Sum( {< consecutive= {$(=myvar)} >} field1)

Its SO MUCH FASTER!

Thanks everybody!!

View solution in original post

3 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It's probably slow because with this kind of expression you are calculating both results every time. See How Not to Choose an Expression | Qlikview Cookbook ‌ for an explanation and solutions.

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

shiveshsingh
Master
Master

It's better you use two expressions and put enable condition like GetSelectedCount(date)=0.


It will be faster.

juan_patrick
Creator
Creator
Author

Thank you for the answers!

I have solved it! But i didnt say thats it was in qlik sense....

I create a variable:

=if(GetSelectedCount(date) = 0, '$(=Max(consecutive))', concat(distinct consecutive,','))

And in the expression I call it:

Sum( {< consecutive= {$(=myvar)} >} field1)

Its SO MUCH FASTER!

Thanks everybody!!