Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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
MVP
MVP

Re: Count the result of GetFieldSelections()

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

4 Replies
MVP
MVP

Re: Count the result of GetFieldSelections()

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

Re: Count the result of GetFieldSelections()

what does p() do?

MVP
MVP

Re: Count the result of GetFieldSelections()

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

MVP
MVP

Re: Count the result of GetFieldSelections()

Hi,

To get the count of selected values you can simply use

GetSelectedCount(FieldName)

Hope this helps you.

Regards,

jagan.