Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count the result of GetFieldSelections()

Hello is there any way to count the result of a GetFieldSelections variable?

(Sum({<[Sales Rep Goal Percents.Month] = {$(=vMonthSelection)}>}[Sales Rep Goal Percents.Percent]) / (COUNT($(=vMonthSelection)) * 32)) * Sum([Goal Data.2016 GOAL])

vMonthSelection defined as:

=GetFieldSelections([Month])

I want to count the number of months selected if the user selects more than 1 month. I can see that it looks like an array so does Qlik sense support counting selections?

Please help

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe this could be helpful as well:

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( ) )

View solution in original post

4 Replies
sunny_talwar

May be this:

(Sum({<[Sales Rep Goal Percents.Month] = p(Month)>} [Sales Rep Goal Percents.Percent]) / (COUNT(Month) * 32)) * Sum([Goal Data.2016 GOAL])

Not applicable
Author

what does p() do?

swuehl
MVP
MVP

Maybe this could be helpful as well:

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( ) )

jagan
Luminary Alumni
Luminary Alumni

Hi,

To get the count of selected values you can simply use

GetSelectedCount(FieldName)

Hope this helps you.

Regards,

jagan.