Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
click_on_qlik
Partner - Contributor II
Partner - Contributor II

Best way to understand P and E function ?

I mean I'm looking for exercises to train myself
easy then hard

Labels (2)
1 Solution

Accepted Solutions
vincent_ardiet_
Specialist
Specialist

Sure, but if you have some difficulties to understand the syntax, using the UI to reproduce the same things could help.
Here you have a syntax error as P needs a parameter. If you want the possible customers having bought the AAA Running shoe (regardless of any current selections), you need to write:
Customer=P({1<ProductName={'AAA Running Shoe'}>} Customer)

View solution in original post

6 Replies
vincent_ardiet_
Specialist
Specialist

Using Set analysis is basically the same as playing with filters on the UI.
P and E are the same as "Select possible" and "Select Excluded".
So, you can test your expression playing with the filters first.
Something I'm also using from time to time, to understand my set analysis behaviour, is to replace something like a sum of values, with a concat(distinct ...) function with the same values, or keys. This is listing what is taking in account and sometimes it helps.

vincent_ardiet__0-1701704152702.png

 

click_on_qlik
Partner - Contributor II
Partner - Contributor II
Author

Ok thanks but i am learning with set analysis like this 

Sum({1<Customer=(P({1<ProductName={'AAA Running Shoe'}>}))>} LineSalesAmount )

 

and I need to masterize that ( not UI but set analysis ) 

vincent_ardiet_
Specialist
Specialist

Sure, but if you have some difficulties to understand the syntax, using the UI to reproduce the same things could help.
Here you have a syntax error as P needs a parameter. If you want the possible customers having bought the AAA Running shoe (regardless of any current selections), you need to write:
Customer=P({1<ProductName={'AAA Running Shoe'}>} Customer)

click_on_qlik
Partner - Contributor II
Partner - Contributor II
Author

Merci Vincent ! ( I assume you understand 😁 )

Bonne soirée 

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If you want to practice and sharpen your set analysis skills an excellent tool is https://qata.io/

-Rob

click_on_qlik
Partner - Contributor II
Partner - Contributor II
Author

I look at this as soon as I finish my current tasks