Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Not applicable

Qlikview IF Statement

Dear Qlikview Gurus

I am trying to display the number of printed orders based on the condition below, but I am struggling to get it right. Can someone please assist?

     IF(MATCH(ORDER_TYPE_ID >= 2150 OR
IF(ORDER_TYPE_ID >= 2100 AND If(Isnull(FIRST_PRINT_DATE)))),1,0) AS PRINTED,  

The script return the following error:

Error in expression:

If takes 2-3 parameters

Thanks

1 Solution

Accepted Solutions

Re: Qlikview IF Statement

Then try this:

IF(ORDER_TYPE_ID >= 2150 OR (ORDER_TYPE_ID >= 2100 AND Isnull(FIRST_PRINT_DATE)), 1, 0) AS PRINTED

3 Replies

Re: Qlikview IF Statement

I think you are using or and if together... try this:

IF(ORDER_TYPE_ID >= 2150 OR ORDER_TYPE_ID >= 2100 AND Isnull(FIRST_PRINT_DATE), 1, 0) AS PRINTED

The statement in red looks redundant. If ORDER_TYPE_ID >= 2100, it will be >= 2150, right? So may be you need just this

IF(ORDER_TYPE_ID >= 2100 AND Isnull(FIRST_PRINT_DATE), 1, 0) AS PRINTED

Not applicable

Re: Qlikview IF Statement

the statement is not redundant. In Oracle script is like this

Select Count(1) PRINTED

FROM ORDER

WHERE order_type_id >= 2150 or (order_type_id >= 2100 and first_print_date is not null)


I would like to convert this script into Qlikview function

Re: Qlikview IF Statement

Then try this:

IF(ORDER_TYPE_ID >= 2150 OR (ORDER_TYPE_ID >= 2100 AND Isnull(FIRST_PRINT_DATE)), 1, 0) AS PRINTED