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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis: error in expression

Hello All,

I am using the expression below to get the count of calls which where hanged up between 1 to 5 seconds :

=Count({<WaitDuration={'>=1'}, WaitDuration={'<=5'}>}IF(

        (timeFROMbegin>=begin1 and timeFROMbegin<=end1)

        OR

        (timeFROMbegin>=begin2 and timeFROMbegin<=end2)

        OR

        (timeFROMbegin>=begin3 and timeFROMbegin<=end3)

        OR

        (timeFROMbegin>=begin4 and timeFROMbegin<=end4)

        OR

        (timeFROMbegin>=begin5 and timeFROMbegin<=end5)

        OR

        (timeFROMbegin>=begin6 and timeFROMbegin<=end6)

        OR

        (timeFROMbegin>=begin7 and timeFROMbegin<=end7)

        OR

        (timeFROMbegin>=begin8 and timeFROMbegin<=end8)   

        OR    

        (timeFROMbegin>=begin9 and timeFROMbegin<=end9)

        OR

        (timeFROMbegin>=begin10 and timeFROMbegin<=end10)

        OR

        (timeFROMbegin>=begin11 and timeFROMbegin<=end11)

        OR

        (timeFROMbegin>=begin12 and timeFROMbegin<=end12)

        OR

        (timeFROMbegin>=begin13 and timeFROMbegin<=end13)

        OR

        (timeFROMbegin>=begin14 and timeFROMbegin<=end14)

         ,ID))

I am got a wrong figure.

Any idea on how to correct the formula.

Many Thanks,

Hasvine

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

Not sure if this will make a difference in the output, but try this:

=Count({<WaitDuration={'>=1<=5'}>} If(

        (timeFROMbegin>=begin1 and timeFROMbegin<=end1)

        OR

        (timeFROMbegin>=begin2 and timeFROMbegin<=end2)

        OR

        (timeFROMbegin>=begin3 and timeFROMbegin<=end3)

        OR

        (timeFROMbegin>=begin4 and timeFROMbegin<=end4)

        OR

        (timeFROMbegin>=begin5 and timeFROMbegin<=end5)

        OR

        (timeFROMbegin>=begin6 and timeFROMbegin<=end6)

        OR

        (timeFROMbegin>=begin7 and timeFROMbegin<=end7)

        OR

        (timeFROMbegin>=begin8 and timeFROMbegin<=end8)  

        OR   

        (timeFROMbegin>=begin9 and timeFROMbegin<=end9)

        OR

        (timeFROMbegin>=begin10 and timeFROMbegin<=end10)

        OR

        (timeFROMbegin>=begin11 and timeFROMbegin<=end11)

        OR

        (timeFROMbegin>=begin12 and timeFROMbegin<=end12)

        OR

        (timeFROMbegin>=begin13 and timeFROMbegin<=end13)

        OR

        (timeFROMbegin>=begin14 and timeFROMbegin<=end14)

         ,ID))

View solution in original post

3 Replies
sunny_talwar
MVP
MVP

Not sure if this will make a difference in the output, but try this:

=Count({<WaitDuration={'>=1<=5'}>} If(

        (timeFROMbegin>=begin1 and timeFROMbegin<=end1)

        OR

        (timeFROMbegin>=begin2 and timeFROMbegin<=end2)

        OR

        (timeFROMbegin>=begin3 and timeFROMbegin<=end3)

        OR

        (timeFROMbegin>=begin4 and timeFROMbegin<=end4)

        OR

        (timeFROMbegin>=begin5 and timeFROMbegin<=end5)

        OR

        (timeFROMbegin>=begin6 and timeFROMbegin<=end6)

        OR

        (timeFROMbegin>=begin7 and timeFROMbegin<=end7)

        OR

        (timeFROMbegin>=begin8 and timeFROMbegin<=end8)  

        OR   

        (timeFROMbegin>=begin9 and timeFROMbegin<=end9)

        OR

        (timeFROMbegin>=begin10 and timeFROMbegin<=end10)

        OR

        (timeFROMbegin>=begin11 and timeFROMbegin<=end11)

        OR

        (timeFROMbegin>=begin12 and timeFROMbegin<=end12)

        OR

        (timeFROMbegin>=begin13 and timeFROMbegin<=end13)

        OR

        (timeFROMbegin>=begin14 and timeFROMbegin<=end14)

         ,ID))

Not applicable
Author

Thanks for your help Sunny. 🙂

KR,

Hasvine

tresB
Champion III
Champion III

When you use same field reference more than once in set analysis it takes the first reference into calculation, so when you use   ({<WaitDuration={'>=1'}, WaitDuration={'<=5'}>} , the expression would actually take the first reference (i.e - {<WaitDuration={'>=1'} ) and would get result accordingly. The solution is suggested by Sunny T above.