Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
brindlogcool
Creator III
Creator III

Difference

What is the difference between

 

=Count (DISTINCT {$<Field1= Field1>} Field2)

and

=Count (DISTINCT {$<Field1= P(Field1)>} Field2)

P() will give the list of possible values and the default function of Qlikview is also provides the list of possible values based on the selection. How the P() is different from the defalution selection subset

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Both are the same as Count (DISTINCT Field2).

The use of the p() function is usually when you use a set modifier inside it. For example to find customers that have sales this year, but also last year:

count({<Year={2013},Customer=p({<Year={2012}>}Customer)>} Customer)

count({<Year={2012,2013}>} Customer) would only count the customers that have sales in 2012 and/or 2013, not necessarily in both 2012 and 2013.


talk is cheap, supply exceeds demand
brindlogcool
Creator III
Creator III
Author

Thanks Gysbert Wassenaar, Really helpful answer let me check the scenarios what you had given

brindlogcool
Creator III
Creator III
Author

Thanks Gysbert Wassenaar, Really helpful answer let me check the scenarios what you had given