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: 
hammermill21
Creator III
Creator III

How to do a count of a word in a table - Qlik Sense

Hello,

I have a table that has a few columns that have pass or fail, at the end, I want to have a final Pass/Fail Test column showing that if all the columns contain "pass" the full test Passes if not it fails.

Capture.JPG

I tried to count the pass or fails and that does not seem to work.  I also tried:

=count({<Your Dimension={'Pass','Fail'}>} Your Dimension) which didn't work either. To get the pass or fail for the "30%" column I have the function: =If([Actual Load Percentage] > 30, 'Pass', 'Fail') and for the "35 mins" pass or fail I have the following function: =If([Total Duration of Test] > 35, 'Pass', 'Fail')


Thank you!

1 Solution

Accepted Solutions
agigliotti
Partner - Champion
Partner - Champion

let's try using the below expression:

=If( [Actual Load Percentage] > 30 and [Total Duration of Test] > 35, 'Pass', 'Fail')

View solution in original post

18 Replies
sunny_talwar

Is this something you want to do in the script or front end?

niclaz79
Partner - Creator III
Partner - Creator III

Hi,

Why don't you just do a if(column(3) = 'Pass' AND column(7) = 'Pass','Pass','Fail')?

hammermill21
Creator III
Creator III
Author

Hey Sunny!

In the front end is fine.

hammermill21
Creator III
Creator III
Author

Hey Niclas,

I tried that also but that doesn't work. Or maybe I'm doing that wrong also?!

niclaz79
Partner - Creator III
Partner - Creator III

Hi,

This could be related to that you are not referencing the correct columns. However you can simply add the if-conditions for each pass/fail column and put them together with AND:

if(if-expression1 AND if-expression2,'Pass','Fail')

This makes maintenance a bit more cumbersome in case target values change etc but that can be managed by variables.

umartareen
Creator II
Creator II

How are you calculating the condition for Pass and Fail ? Have you calculated a field from the backend  or applying a condition in Column 3 and Column 7 to calculate pass or fail ?

sunny_talwar

May be this

Sum(If([30%] = 'Pass' and [35 mins] = 'Pass', 1, 0))

hammermill21
Creator III
Creator III
Author

So for column 3, I use column 2 to calculate the pass or fail:

=If([Actual Load Percentage] > 30, 'Pass', 'Fail')

And for column 7, I use column 6:

=If([Total Duration of Test] > 35, 'Pass', 'Fail')

agigliotti
Partner - Champion
Partner - Champion

let's try using the below expression:

=If( [Actual Load Percentage] > 30 and [Total Duration of Test] > 35, 'Pass', 'Fail')