Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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

1 Solution

Accepted Solutions

Re: Set analysis: error in expression

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))

3 Replies

Re: Set analysis: error in expression

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

Re: Set analysis: error in expression

Thanks for your help Sunny. :-)

KR,

Hasvine

MVP
MVP

Re: Set analysis: error in expression

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.

Community Browser