Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Customers, Partners & Luminaries only: You're invited to a Data Analytics Roadmap session. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

what is different between getpossiblecount and count functions

Hi,

Somebody can tell What is different between getpossiblecount() and Count() functions?

Regards

Loi

4 Replies
Specialist II
Specialist II

Hi,

Count is normal aggr function, where you can count ant field, like

Count(EmployeeId) it will give you number of employees.

where getpossiblecount() works with selection, when you select a field, you see possible values for that field,

let say you select Department in list box, and on selection of Department you can see how many employees are in selected department, so you can use getpossiblecount() for the counting purpose. it will give you all employee for that selected department.

Hope it helps...

Highlighted
Not applicable

Hi Loi,

GetPossibleCount works more like a distinct count. It gets the count of possible values of the field.

check the attached QVW for an example.

Highlighted

GetPossibleCount() is exactly the same as Count(distinct total ...). Note the total qualifier - this means that the function isn't sensitive to the dimensional scope. See more on http://community.qlik.com/blogs/qlikviewdesignblog/2013/09/09/aggregation-scope

The GetPossibleCount exists as a "sister" function to GetSelectedCount and GetExcludedCount.

HIC

Highlighted
Contributor III
Contributor III

Thanks for your comment Henric.

I was struggling to understand the difference between these two functions as I was designing a calculation condition on one of my charts.  I was trying to understand which is the best practice if there was in fact a difference between these two functions.

As always, your posts help bring clarity when I'm a bit confused on something Qlik related.  Have a nice weekend!

 

-Ken Krehbiel