Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
can anyone explain what is p() and e() ? use ?
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..!
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.
Read the mention thread related to P and E details.
*** 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
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..!
no you are absolutely right .. thanks for calling it out!
thanks to all
Kindly close the thread by selecting appropriate answer