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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
azimabadi
Creator III
Creator III

Set analysis problem

Hi all,

consider this table:

F1F2
1 10
2 20
3 30
4 40
5 50
6 60
7 70
8 80
9 90

and this sum :

     sum( {<F1={">=2<=3"}>} F2 )

result is 50. This means that the result is AND between >=2 and <=3.

Let's consider another expression:

     sum( {<F1={">=9<=1"}>} F2 )

I expect 0 but very interestingly the result is 100 !!!! OR  between >=9 and <=1.

First question is: why QV acts in different ways in above examples?

Second: How can i constract a AND between >=9 and <=1in second example above?

( the sample QVW is attached.)

Best regards

Peyman

1 Solution

Accepted Solutions
gandalfgray
Specialist II
Specialist II

Hi Peyman

I also noticed this behaviour a couple of years ago, and we had some discussion about it here:

http://community.qlik.com/thread/8125?start=0&tstart=0

The solution is to write:

sum({<F1={">9"} * {"<=1"}>} F2)

Regards

G

View solution in original post

4 Replies
azimabadi
Creator III
Creator III
Author

i dont know why the table editor dosn't function!!!!

the table is as below:

F1     F2

1          10

2          20

3          30

4          40

5          50

6          60

7          70

8          80

9          90

Consider this expression :

     sum( {<F1={">=2<=3"}>} F2 )

result is 50. This means that the result is AND between >=2 and <=3.

Let's consider another expression:

     sum( {<F1={">=9<=1"}>} F2 )

I expect 0 but very interestingly the result is 100 !!!! OR  between >=9 and <=1.

First question is: why QV acts in different ways in above examples?

Second: How can i constract a AND between >=9 and <=1in second example above?

( the sample QVW is attached.)

Best regards

Peyman

gandalfgray
Specialist II
Specialist II

Hi Peyman

I also noticed this behaviour a couple of years ago, and we had some discussion about it here:

http://community.qlik.com/thread/8125?start=0&tstart=0

The solution is to write:

sum({<F1={">9"} * {"<=1"}>} F2)

Regards

G

azimabadi
Creator III
Creator III
Author

Hi GandalfGray,

thank you so much for your help .

Best regards

Peyman

gandalfgray
Specialist II
Specialist II

You're welcome

GandalfGray