So far, we have seen how sets can be used to manipulate the result of an expression. To take the concept a bit further, we will now see how to use the P()
and E()
functions inside a Set Analysis expression. In the previous Set Analysis expressions, all field values were explicitly defined in the sets or variables or, in certain cases, through defined searches. The P()
and E()
functions make use of nested set definitions.
A P()
function returns a set of all possible values, while an E()
function returns a set of all excluded values.
For the purpose of this recipe, we make use of customer sales data as defined in the following inline data load. Load the following script in the Qlik Sense Data load editor
:
P_E: LOAD * INLINE [ Customer,Month,Volume,Sales,Supplier ABC,Jan,100,10000,DEF ABC,Feb,100,10000,DEF ABC,Mar,400,12000,DEF ABC,Apr,100,10000,GHI DEF,Feb,200,25000,GHI DEF,Mar,300,25000,GHI DEF,Apr,200,25000,ABC ...