Early Access: The content on this website is provided for informational purposes only in connection with pre-General Availability Qlik Products.
All content is subject to change and is provided without warranty.
Skip to main content Skip to complementary content

GetSelectedCount - chart function

GetSelectedCount() finds the number of selected (green) values in a field.

video thumbnail

Syntax:  

GetSelectedCount (field_name [, include_excluded [, state_name]])

Return data type: integer

Information note

The colors used in the selection bar, and for each selection state, can be modified with a custom theme. If you are working with an app that uses a custom theme, you might notice that your selections do not display with the same colors that are described in this help topic.

Arguments
Arguments Description
field_name The field containing the range of data to be measured.
include_excluded If set to 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_name

The name of an alternate state that has been chosen for the specific visualization. If the state_name argument is used, only the selections associated with the specified state name are taken into account.

For more information, see Using alternate states for comparative analysis.

The following table lists other functions that are related to this function.

Related functions
Function Interaction
GetStateCounts - chart function

Using GetStateCounts(), you can combine the calculation of the following counts using a single function call:

  • Count of selected included values.

  • Count of possible values.

  • Count of alternative values.

  • Count of excluded values, not including alternative and selected excluded values.

  • Count of selected excluded values.

GetPossibleCount - chart function Returns the count of possible values.
GetAlternativeCount - chart function Returns the count of alternative values.
GetSelectedCount - chart function Returns the count of excluded values, not including alternative and selected excluded values.
Example: Chart expressions
Example Result
GetSelectedCount (FirstName)

If no selections are made then 0 is returned. If any selections have been made in the FirstName field then the number of items selected is returned.

GetSelectedCount (FirstName, True()) If no selections are made then 0 is returned. If any selections have been made in the FirstName field then the number of items selected is returned regardless of any subsequent selections in other fields that might reduce the available values in the FirstName field.

Example - GetSelectedCount fundamentals

Example - GetSelectedCount with include_excluded parameter

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!