Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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
Contributor II

Re: IF function with multiple values

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

3 Replies

Re: IF function with multiple values

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)

prashantbaste
Contributor II

Re: IF function with multiple values

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

Re: IF function with multiple values

Tha nks Mayil and Prasant

Community Browser