Skip to main content Skip to complementary content

GetAlternativeCount

GetAlternativeCount() is used to find the number of alternative (light gray) values in the identified field.

Syntax:  

GetAlternativeCount (field_name)

Return data type: integer

Arguments:  

  • field_name: The field containing the range of data to be measured.

Examples

The following examples use the First name field loaded to a list box, and the following syntax:

GetAlternativeCount ([First name])

  • Given that John is selected in First name, the script returns 4 as there are 4 unique and excluded (gray) values in First name.
  • Given that John and Peter are selected, the script returns 3 as there are 3 unique and excluded (gray) values in First name.
  • Given that no values are selected in First name, the script returns 0 as there are no selections.

Data used in example:

Names:

LOAD * inline [

"First name"|"Last name"|Initials|"Has cellphone"

John|Anderson|JA|Yes

Sue|Brown|SB|Yes

Mark|Carr|MC |No

Peter|Devonshire|PD|No

Jane|Elliot|JE|Yes

Peter|Franc|PF|Yes ] (delimiter is '|');

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!

Join the Analytics Modernization Program

Remove banner from view

Modernize without compromising your valuable QlikView apps with the Analytics Modernization Program. Click here for more information or reach out: ampquestions@qlik.com