Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

hammermill21
Contributor II

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
Honored Contributor II

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

let's try using the below expression:

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

18 Replies

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

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

niclaz79
Contributor III

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

Hi,

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

hammermill21
Contributor II

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

Hey Sunny!

In the front end is fine.

hammermill21
Contributor II

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

Hey Niclas,

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

niclaz79
Contributor III

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

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
Contributor

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

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 ?

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

May be this

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

hammermill21
Contributor II

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

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
Honored Contributor II

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

let's try using the below expression:

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

Community Browser