Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Issue with GetSelectedCount() when using IncludeExcluded parameter

I thought using GetSelectedCount(FieldName, True()) was supposed to return the total number of distinct values in a field?

It works for GetSelectedCount(FieldName) where the selected values are returned but I would like to get the total number of values in the field.

For

LOAD

* INLINE [
F1, F2, F3
01/01/2012, 01/01/2013, 1
01/01/2012, 02/01/2013, 2
01/01/2012, 03/01/2013, 3
02/01/2012, 01/02/2013, 4
02/01/2012, 02/02/2013, 5
02/01/2012, 03/02/2013, 6
]

;

I'd expect GetSelectedCount(F1, True()) to return 2 at all times (as only 2 unique values) but this isn't happening.

Is the only way (?) to do the following instead?

Count (Distinct All F1)

1 Solution

Accepted Solutions

Re: Issue with GetSelectedCount() when using IncludeExcluded parameter

You can use fieldvaluecount('F1') too. That's likely the best performing way to get that number.


talk is cheap, supply exceeds demand
5 Replies

Re: Issue with GetSelectedCount() when using IncludeExcluded parameter

You can use fieldvaluecount('F1') too. That's likely the best performing way to get that number.


talk is cheap, supply exceeds demand
Not applicable

Re: Issue with GetSelectedCount() when using IncludeExcluded parameter

Excellent,

Is there another easy one for All values i.e. F1 above would return 6.

Thanks

Re: Issue with GetSelectedCount() when using IncludeExcluded parameter

count( all F1)


talk is cheap, supply exceeds demand
whiteline
Honored Contributor II

Re: Issue with GetSelectedCount() when using IncludeExcluded parameter

Hi.

You can also calculate the value in script in a floating table.

Not applicable

Re: Issue with GetSelectedCount() when using IncludeExcluded parameter

Do you mean creating a table in the script that wouldn't be linked up to anythng else but would hold these values?

Community Browser