# QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
New Contributor III

## Issue with "If" statement

Hi I am trying to evaluate this "If" statement, but it doesn't work as expected:

If(Priority= 'Critical',if(Mins>60,1,0),'NC') as MissFlg

Below is the data and the output:

Priority            Mins      MissFlg

Critical               3            0

Critical               40          0

Critical               70          0

High                  50         NC

For the 3rd row the MissFlg should evaluate to 1, as no of Mins is greater than 60, but it doesn't work.The outer If appears to work though(per the resilut in 4th row).

Note: The MIns is a filed calculated from an earlier calculation which holds minutes difference between 2 timestamps.

Tags (4)
1 Solution

Accepted Solutions
New Contributor III

## Re: Issue with "If" statement

I used the Num# and it works!

If(Priority= 'Critical',if(Num#(Mins)>60,1,0),'NC') as MissFlg

6 Replies
Honored Contributor II

## Re: Issue with "If" statement

Try with:

If(Priority= 'Critical',if(Num(Mins)>60,1,0),'NC') as MissFlg

New Contributor III

## Re: Issue with "If" statement

Thanks Enrique for the quick turn.

I tried the Num function, but it didnt work.

New Contributor III

## Re: Issue with "If" statement

I changed the condition as:

If(Priority= 'Critical',if(Mins>0,1,0),'NC') as MissFlg

and it did work for Mins which are greater than 0, but when I change it to non-zero, it appears it doesn't work.

New Contributor III

## Re: Issue with "If" statement

I had just copied the part of code for better understanding, now I am copying the entire code incase if it helps:

if(Project='ABC',

If(Priority= 'Critical',if(Mins>60, 1,0),if(Priority='High', if(Mins>300,1,0),if(Priority='Medium', if(Mins>2880,1,0),if(Priority='Low', if(Mins>4320,1,0),'Not Priortized')))),

if(Project='XYZ',

If(Priority= 'Critical',if(Mins>60, 1,0),if(Priority='High', if(Mins>300,1,0),if(Priority='Medium', if(Mins>2880,1,0),if(Priority='Low', if(Mins>4320,1,0),'Not Priortized')))),'NA')) as MissFlg

Valued Contributor III

## Re: Issue with "If" statement

The script given below generates the output shown below:

Priority,Mins

Critical,3

Critical,40

Critical,70

High,50

];

New Contributor III