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: 
Not applicable

evaluate()

juraj.misina lets say data is like:

tab1:

load * inline [
bal,conditin,coef
1,0,1
1,<0,2
1,<0,3
1,>0,4
]
;
tab2:
load
If(conditin=0,(bal*coef),if(Evaluate(bal&conditin),(bal*coef),0)) as "new bal" Resident tab1;

please tell me here what exactly Evaluate(bal&conditin)   is doing?

1 Solution

Accepted Solutions
senpradip007
Specialist III
Specialist III

bal&conditin returns


10

1<0

1<0

1>0


Now Evaluate() returns

10 as 10

1<0 means false ie 0

1>0 means true ie -1

View solution in original post

9 Replies
senpradip007
Specialist III
Specialist III

bal&conditin returns


10

1<0

1<0

1>0


Now Evaluate() returns

10 as 10

1<0 means false ie 0

1>0 means true ie -1

juraj_misina
Partner Ambassador Affiliate
Partner Ambassador Affiliate

Hello bmggeddam. It is exactly as senpradip007 says.

Not applicable
Author

when i put fields in chart, the o/p is as follows can u tell me y it happens?@Pradip Sen

balcoefconditinnew bal
1100
1101
1104
12<00
12<01
12<04
13<00
13<01
13<04
14>00
14>01
14>04
anbu1984
Master III
Master III

Did you use the same expr for "New bal" as in your post?

I am getting different "New bal" compared to above result

juraj_misina
Partner Ambassador Affiliate
Partner Ambassador Affiliate

Seems like cartesian product, check table viewer if your tables are connected (have a common key field).

If you used the exact script from your first post, then adjust the second load to:

tab2:
load

coef,
If(conditin=0,(bal*coef),if(Evaluate(bal&conditin),(bal*coef),0)) as "new bal" Resident tab1;


To create a connection between the tables.

Not applicable
Author

s,

If

(conditin=0,(bal*coef),if(Evaluate(bal&conditin),(bal*coef),0)) as

"new bal"


Not applicable
Author

s there was no connection juraj, but can u elaborate y it takes cartesian product

juraj_misina
Partner Ambassador Affiliate
Partner Ambassador Affiliate

This is how QlikView behaves when you put fields from disconnected tables into a tablebox. QV cannot determine a link (because it does not exist), so it shows all possible combinations.

Be careful with this, it can have serious impact on performance (although disconnected tables - data islands - can be useful if properly used).

Not applicable
Author

s juraj, i am asking by taking wat fields in to account; cartesian product is applied at every iteration?