Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello.
I've been researching how to get a field selection count for various fields in various alternate states and am not really seeing how to execute the formula. I've tried different things but finally decided to throw it out to you experts.
Here's my ultimate goal...I need to be able to do a logical test on whether at least one field selection has been made in various alternate states. I am looking for either a true (there has been at least one selection made in a specific field) or false (no selections have been made).
Here's what I'm using without alternate state and it works fine...
GetSelectedCount([Field_A]) > 0
--1 = yes there was at least one selection made
0 = no selection was made
I need to add alternate state to this but it can't be done in the alternate state box on the general tab because I will need to do a nested formula where I look at selection counts for multiple fields in multiple alternate states. How would I add alternate state to the formula above?
Thanks so much for your help.
Like this for example, state name with quotes
=GetSelectedCount(Year,False(),'Group')
Hi pepsiyummie!
You might be able to do that through Set Analysis, using the " [State Identifier]" and "::".
Have a look at the Built-in Help in Qlikview.
Or if you could attach a sample of what you need....
Have a nice day!
Alex
Depending on which version of qlikview you are using, there is a (3rd) parameter in GetSelectedCount for that. I think starting 11.2 SR5(?) or so
From the 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( ) )
I did see that in help but when I tried to implement it I was clearly not doing it right. Can you please help me by translating this formula...
=GetSelectedCount([Field_A]) > 0
into the help formula...
getselectedcount (FieldName [, IncludeExcluded [, State]])
I had no success at it! Thanks so much.
Like this for example, state name with quotes
=GetSelectedCount(Year,False(),'Group')
Bingo! That is exactly what I needed. Thank you all for your help.
Piet - you nailed it for my particular example. Thanks so much.
I am always very grateful for the help of this community!
You're welcome