Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
Can I use "GetSelectedCount" with alternative state?
I am trying to create a conditional for my expression: sum({[Simulation State]}if([Project type] ='Back up project', Hours)) so that it would do the calculation only if there is at least one value selected in a field "Back up projects".
When I try if(GetSelectedCount( {[Simulation State]} [Back up projects])<>0, ....) it shows error line for the Alt State first curly bracket.. Is it a syntax problem? If I add only() between getselectedcount and alt state it says expression OK but it doesn't make it work as I want.
Thank you community already advanced!
Regards,
Heidi
=GetSelectedCount( [Back up projects], False(), 'Simulation State')
Have a look here: Re: GetSelectedCount and Alternative State
state is the 3rd parameter, field the 1st
this is from Qlik help
getselectedcount (FieldName [, IncludeExcluded [, State]])
Returns the current number of selected values in a field. It is possible to query an alternate state.
If IncludeExcluded is true the count will include selected values, which are currently excluded by selections in other fields. If false or omitted these values will not be included.
State is the alternate state to query.
Examples
getselectedcount ( Year )
getselectedcount ( Year, true( ) )
=GetSelectedCount( [Back up projects], False(), 'Simulation State')
It shows an error after the false and without the false() it doesn't work either?
If you are using a version older than 11.2 SR8, the above won't work. This is because it got introduced in SR 8.
HTH
Best,
Sunny
Link for SR8 Beta Release which talks about this new added functionality in SR8: QlikView 11.20 Service Release 8 Beta is now available
Hi!
Thank you Sunny and swuehl! I updated to the SR12 version and now everything works as they should (:
Regards,
Heidi
Awesome
I am glad we were able to help.
Best,
Sunny