Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
davoud-jelodar
Contributor II
Contributor II

Set expression return incorrect value.

I have a table with 3 fields, f1, f2 and value. the table is:

LOAD * Inline[
f1, f2, value
A , X , 1
A , Y , 1
B , X , 1
B , Y , 1
C , X , 1
C , Y , 1];

in qlikview I select f2 = X. the expression sum({$<f2={Y}>} value) return 3 instead of 0. In the picture you can see that. I don't know why? 

Labels (1)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

Hello @davoud-jelodar ,

'$' is applicable for rest of the other fields which are not explicitly mentioned in the set. To achieve the behavior you are talking about, try using intersection operator, like below:

sum({$<f2*={Y}>} value) 

View solution in original post

5 Replies
Or
MVP
MVP

This is correct and behaving as expected. f2={Y} means return rows where F2 is Y, and there are three such rows. This overrides any selection made on the field.

davoud-jelodar
Contributor II
Contributor II
Author

Thanks, but I selected f2=X then must be returned zero not 3. Your answer is correct if nothing selected. Notice that I use "$" sign (=active current selection) then sum must be 0.

Heidenreich
Contributor
Contributor

As a test, I added a decimal variable and ran the same CASE expression against it and it works fine, returning the results as I would expect (rounding the value up when IsGun=1. But when I run that same CASE expression against another decimal value, it always returns the value with the CEILING() function and never returns the original value.

MyAccountAccess

may my info helpful 

tresesco
MVP
MVP

Hello @davoud-jelodar ,

'$' is applicable for rest of the other fields which are not explicitly mentioned in the set. To achieve the behavior you are talking about, try using intersection operator, like below:

sum({$<f2*={Y}>} value) 

davoud-jelodar
Contributor II
Contributor II
Author

Thank you