Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Gysbert_Wassenaar

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


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Gysbert_Wassenaar

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
Author

Excellent,

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

Thanks

Gysbert_Wassenaar

count( all F1)


talk is cheap, supply exceeds demand
whiteline
Master II
Master II

Hi.

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

Not applicable
Author

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