Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
ptl14495
Contributor III
Contributor III

Count if

Hi,

I have a table with two fields i want to use as a condition to count the number of orders that fulfill that condition.

Something like,

If ( Actual Response Time > Contractual Response time, Count ( Order No ), if not don't count )

I am not confortable doing it in script so i need a solution if possible, as an expression.

thank you

Fernando Rodrigues

1 Solution

Accepted Solutions
sunny_talwar

Oh so they all come from the same table? Is it possible that all Order No_ meet the condition? Can you check this by creating a table like this

Dimensions

Order No_

Actual Response Time (Hours)

Response Time

Measure

[Actual Response Time (Hours)] > [Response Time]

and see if you are seeing  any 0s or not?

View solution in original post

15 Replies
sunny_talwar

May be this

Count({<[Order No] = {"=[Actual Response Time] > [Contractual Response time]"}>} [Order No])

sunny_talwar

Alternatively, you can use an if statement

Count(If([Actual Response Time] > [Contractual Response time], [Order No]))

ptl14495
Contributor III
Contributor III
Author

Hi,

the formulas has some error. It can't be aplied.

I have tried to reposition the " and {} but with no success.

Can you help please?

thank you

sunny_talwar

Where exactly are you trying to use this? Can you show an image of the error that you are seeing?

ptl14495
Contributor III
Contributor III
Author

count or if.JPG

sunny_talwar

I see no error, this expression gives 0 as result?

ptl14495
Contributor III
Contributor III
Author

the result is the count of all order no.

sunny_talwar

Did you try this?

Count(If([Actual Response Time] > [Contractual Response time], [Order No]))

ptl14495
Contributor III
Contributor III
Author

order count.JPG