Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

ziabobaz
Contributor II

P() and E() in one line

Hi!

I have:


Screenshot_14.jpg


[status] is DUAL


I want to sum orders created, but never delivered, but it returns nothing:


sum( {<OrderN= P({<status={"order-created"}>})*E({<status={"order-delivered"}>}) >} SUM) )

sum( {<OrderN= P({<status={"order-created"}>})-P({<status={"order-delivered"}>}) >} SUM) )


I want to sum orders created and delivered, but it also returns nothing:

sum( {<OrderN= P({<status={"order-created"}>})*P({<status={"order-delivered"}>}) >} SUM) )


Finally, is that possible to refer to the value of the field in set analysis?

For example,

sum( {<OrderN= P({<status={"order-created"}>}), status={"$(=num(status)-1)"}>}) >} SUM) )   // since my status is Dual. I want to refer to the previous status of the current one (say, if 'created' is selected, i want to show the results for 'ready', which is previous to created)


your advice will be much appreciated!




1 Solution

Accepted Solutions
MVP
MVP

Re: P() and E() in one line

Seems to be working for me

Capture.PNG

Your sample seems to have sum, but you are using SUM in your expression... could that be the issue?

3 Replies
MVP
MVP

Re: P() and E() in one line

Seems to be working for me

Capture.PNG

Your sample seems to have sum, but you are using SUM in your expression... could that be the issue?

MVP
MVP

Re: P() and E() in one line

I tried it in QlikView, I am sure Qlik Sense will work the same way

ziabobaz
Contributor II

Re: P() and E() in one line

it was my wrong

I was expecting 300 and 100 as a result, but now i understand

thank you