Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

IF function with multiple values

Hi All,

Can we use the below script while loading:

sum(if(match(A,'[00:30 hrs]','[01:00 hrs]','[01:30 hrs]') and B='Processed', 1,0) ) as C

If not, please suggest an alternative.

My requirement is to get the count of total records  in a field called C where

A=00:30 hrs , 01:00 hrs , 01:30 hrs

and

B=Processed

TIA

Regards,

Rishikesh

1 Solution

Accepted Solutions
prashantbaste
Partner - Creator II
Partner - Creator II

Hi Kumar Rishikesh


You can use

sum(if(match(A,'[00:30 hrs]','[01:00 hrs]','[01:30 hrs]') and B='Processed', 1,0) ) as C

but then you need to use groupby with respect too some field to get desired result.

Hope this will be helpful for you.

--

Regards,

Prashant P Baste

View solution in original post

3 Replies
MayilVahanan

Hi

Try like this'

In Script:

if(match(A,'[00:30 hrs]','[01:00 hrs]','[01:30 hrs]') and B='Processed', 1,0)  as C


Then in front end, you can use Sum(C)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
prashantbaste
Partner - Creator II
Partner - Creator II

Hi Kumar Rishikesh


You can use

sum(if(match(A,'[00:30 hrs]','[01:00 hrs]','[01:30 hrs]') and B='Processed', 1,0) ) as C

but then you need to use groupby with respect too some field to get desired result.

Hope this will be helpful for you.

--

Regards,

Prashant P Baste

Not applicable
Author

Tha nks Mayil and Prasant