Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey,
I am trying to implement the P() and E() in sample application but couldn't do so.
In P() expressions, it seems they are not giving the expected results.
Can anyone help me in this?
Thanks
What are you trying to do?
What results do you get? And what do you expect?
Hi Nikhil, I see it right, in example:
Sum({<Customer = P({<Product = {'Shoe'}>}Customer)>}Sales)
It's translated as: Summarize the sales of the customers who has buy 'Shoe'. Thats all the sales of those customers, not only the 'Shoe' Sales.
Shoe was sold to Cutomer1, customer2 and [blank] customer, so it's the same as:
Sum({<Customer={'','Customer1','Customer2'}>}Sales) //Wich result is 1800
Sales Customer '': 1500
Sales Customer 'Customer1': 100
Sales Customer 'Customer2': 200
What in the result is unexpected? If I select 'Shoe', I get the following result:
and this corresponds in my mind quite well with what the P() function returns: You have numbers for the correct suppliers (blank, 3, 4 and 5) but 0 for the excluded ones (1, 2 and 6).
HIC
Hey,
But as per my understanding,
P({<Product = {'Shoe'}>}Customer)
will give the sum of sales for Customer only and not for Suppplier.
Please correct me if i am wrong.
Thanks
Hey,
But as per my understanding,
P({<Product = {'Shoe'}>}Customer)
will give the sum of sales for Customer only and not for Suppplier.
also if you see in 2nd a nd 3rd expression, i want sum of sales but i am getting sum for other products as well
Please correct me if i am wrong.
Thanks
Hey,
But as per my understanding,
P({<Product = {'Shoe'}>}Customer)
will give the sum of sales for Customer only and not for Suppplier.
also if you see in 2nd a nd 3rd expression, i want sum of sales but i am getting sum for other products as well
Please correct me if i am wrong.
Thanks
No, it has nothing to do with the sum of sales. The P() returns the Customers that are associated with 'Shoe'. That's all.
And when you use the above function the way you do, you will get sum of sales for customers that are associated with 'Shoe'. All sales, independent of product and supplier. The only filter is on customers.
HIC
If you want sum of sales only for 'Shoe', you should use
Sum({<Product = {'Shoe'}>}Sales)
and if you, in addition, want to exclude records where the customer is NULL, you should use
Sum({<Product = {'Shoe'}, Customer={"*"}>}Sales)
HIC
P({<Product = {'Shoe'}>}Customer) returns the customers who has relation with product Shoe, if you want only Shoe sales you can add that condition to set analysis:
Sum({<Customer = P({<Product = {'Shoe'}>}Customer), Product = {'Shoe'}>}Sales)
Wich doesn't makes more sense as you can directly ask for Product = {'Shoe'}.
It can be usefull in something like:
Sum({<Customer = P({<Product = {'Shoe'}>}Customer), Product = {'Socks'}>}Sales)
It returns the sales of Socks for the customers who has a relation with Shoe