Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
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
sunny_talwar

Then try this:

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

View solution in original post

3 Replies
sunny_talwar

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
Author

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

sunny_talwar

Then try this:

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

View solution in original post