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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

what is the difference between p() and e() ?

Hi ,

  can anyone explain what is p() and e() ? use ?

Labels (1)
1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Hi Jonathan,

Sorry but not agree with your statements...

sum( {$<Customer = P({1<Product={‘Shoe’}>})>} Sales )

... this is all data WHERE product=shoe  XXXXXXX

This is actually SUM(Sales) for Customers who bought Shoe at least once ..!!


sum( {$<Customer = E({1<Product={‘Shoe’}>})>} Sales )

... this is all data WHERE NOT product=shoe XXXXXXXX

This is actually SUM(Sales) for Customers who never bought Shoe ...


Of Cource, the above two will be affected by current selection...

let me know if I am wrong..!


View solution in original post

7 Replies
MK_QSL
MVP
MVP

P() representing the element set of possible values

sum( {$<Customer = P({1<Product={‘Shoe’}>})>} Sales)

returns the sales for current selection, but only those customers that ever have bought the product ‘Shoe’. The element function P( ) here returns a list of possible customers; those that are implied by the selection ‘Shoe’ in the field Product.

E() representing the element set of excluded values

sum( {$<Customer = E({1<Product={‘Shoe’}>})>} Sales )

returns the sales for current selection, but only those customers that never bought the product ‘Shoe’. The element function E( ) here returns the list of excluded customers; those that are excluded by the selection ‘Shoe’ in the field Product. 

its_anandrjs
Champion III
Champion III

Read the mention thread related to P and E details.

P() &amp; E()

JonnyPoole
Former Employee
Former Employee

*** NOTE:  SEE CORRECTION BELOW IN THREAD ***

A very common usage of p() and e() is to do a filter of the global set of data in QLIK.

In that situation, p() is like a 'WHERE' clause and e() is like a 'WHERE NOT'  clause.

its a simplistic situation but it helps me...

sum( {$<Customer = P({1<Product={‘Shoe’}>})>} Sales )

... this is all data WHERE product=shoe

sum( {$<Customer = E({1<Product={‘Shoe’}>})>} Sales )

... this is all data WHERE NOT product=shoe

MK_QSL
MVP
MVP

Hi Jonathan,

Sorry but not agree with your statements...

sum( {$<Customer = P({1<Product={‘Shoe’}>})>} Sales )

... this is all data WHERE product=shoe  XXXXXXX

This is actually SUM(Sales) for Customers who bought Shoe at least once ..!!


sum( {$<Customer = E({1<Product={‘Shoe’}>})>} Sales )

... this is all data WHERE NOT product=shoe XXXXXXXX

This is actually SUM(Sales) for Customers who never bought Shoe ...


Of Cource, the above two will be affected by current selection...

let me know if I am wrong..!


JonnyPoole
Former Employee
Former Employee

no you are absolutely right .. thanks for calling it out!

Not applicable
Author

thanks to all

MK_QSL
MVP
MVP

Kindly close the thread by selecting appropriate answer