Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
kamal_sanguri
Specialist
Specialist

Problem with E()

Hi,

I was working with P & E () (In process of learning them).. I think, I got some understanding of both of the functions.. but still I stuck in a situation where E() is not returning the expected value..

Attaching a qvw.. Pls help me to understand what the problem is..

Thanks,

-Kamal

9 Replies
sushil353
Master II
Master II

Hi,

your Cust field Is not linked with the customer table, that is why your expression is not working,

='Customer not listed as Cust (Only C) using E but not getting correct value - ' & sum({<Customer=e({<Customer={'A','B'}>}Customer)>}Value)

HTH

kamal_sanguri
Specialist
Specialist
Author

Thanks Sushil for looking into it. Yes, I know.. it will work this way but I don't understand why it is not working with '*'. Currently, I have only 'C' not listed in Cust list. However, this list may get change or we may have 'A' or/and 'B' leaving that list. or, if more items in future are added then it would not be a good idea to modify the expression all the time.

Thanks,

-Kamal

kamal_sanguri
Specialist
Specialist
Author

If you look at the middle text box,  '-=p' is giving the desired result ( equivalent to E ) but still I am confused why E() is not behaving correctly.

Thanks,

-Kamal

kamal_sanguri
Specialist
Specialist
Author

connection between Customer and is not required.. look at the first 2 text boxes.. they are giving the correct result.

Even, if you use sum({<Customer=e({<Cust={'A,B'}>}Cust)>}Value).. it will work absolutely fine.. even though there is no connection between Customer and Cust.

Thanks,

-Kamal

Anil_Babu_Samineni

Kamal,

You are saying - Got some idea. But, In qvw i didn't see any implementation tables using Possible - P() and Exclude = E().

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
kamal_sanguri
Specialist
Specialist
Author

check the expression behind Text objects..

Thanks,

-Kamal

kamal_sanguri
Specialist
Specialist
Author

the problem is expression in third text box is not giving correct result.

Anil_Babu_Samineni

Usually, P() Vs E()

sum( {$<Customer = P({1<Product={‘Shoe’}>} Customer)>} Sales )
returns the sales for current selection, but only those customers that ever have bought the product ‘Shoe’. The element function P( ) here returns a list of possible customers; those that are implied by the selection ‘Shoe’ in the field Product


sum( {$<Customer = E({1<Product={‘Shoe’}>})>} Sales )

returns the sales for current selection, but only those customers that never bought the product ‘Shoe’. The element function E( ) here returns the list of excluded customers; those that are excluded by the selection ‘Shoe’ in the field Product.





Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
kamal_sanguri
Specialist
Specialist
Author

Hi stalwar1, if you could have a look on it per your convenience.

Many Thanks,

-Kamal