Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikview979
Specialist
Specialist

P(),E() functions

Hi Experts,

In our qlikview i know  how to use Indirect set analysis like P(),E()  functions.

for example i want  show how are purchased Shoes

for that i will use P() condition

sum({<customer=P(Product={'shoes'}customer)>}sales) (This is give the who are purchased shoes)

sum({<Product={'shoes'}>}sales)   (this will also give same result)


why should we go for

sum({<customer=P(Product={'shoes'}customer)>}sales)


why not this


sum({<Product={'shoes'}>}sales)

ProductCustomersales

  

ShoesMadhu1500
W.MMadhu8000
T.VMadhu25000
LaptopMadhu50000
W.MRavi15000
T.VRavi27000
LaptopRavi70000
ShoesRaja4200
W.MRaja17000
T.VRaja32000
LaptopRaja1000000
1 Solution

Accepted Solutions
Kushal_Chawda

see the difference below, based on your data

1) sum({<Product={'shoes'}>}sales)


Returns the sales of customer who bought only one Product='Shoes'


2) sum({<customer=P({<Product={'shoes'}>}customer)>}sales)


Returns the total sales of customer who ever bought Product='Shoes'


P({<Product={'shoes'}>}customer) gives list of customer who bought Product Shoes

So for each row for that list of customers, customer=P({<Product={'shoes'}>}customer) condition satisfies and gives sum of sales for all products associated with that customer



So based on requirement you can choose your expression

If you want sales of individual product then go for 1st expression

If you want sales of all product of customer who bought shoes go for 2nd expression

View solution in original post

4 Replies
qlikview979
Specialist
Specialist
Author

Here my Question is At


what situation will  go for Indirect Set analysis ?

Sergey_Shuklin
Specialist
Specialist

Hello, Mahesh!

It can be used for instance when you use an alter states. QV help tells us this example:

count({$<[Invoice Number] = p({State1} [Invoice Number]) * p({State2} [Invoice Number])>} DISTINCT [Invoice Number])

This means an intersection of two possible states.

It can be used in different situations like show to user a couple of values depend on current selection.

qlikview979
Specialist
Specialist
Author

Not clear.

Kushal_Chawda

see the difference below, based on your data

1) sum({<Product={'shoes'}>}sales)


Returns the sales of customer who bought only one Product='Shoes'


2) sum({<customer=P({<Product={'shoes'}>}customer)>}sales)


Returns the total sales of customer who ever bought Product='Shoes'


P({<Product={'shoes'}>}customer) gives list of customer who bought Product Shoes

So for each row for that list of customers, customer=P({<Product={'shoes'}>}customer) condition satisfies and gives sum of sales for all products associated with that customer



So based on requirement you can choose your expression

If you want sales of individual product then go for 1st expression

If you want sales of all product of customer who bought shoes go for 2nd expression