Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Karahs
Partner - Creator
Partner - Creator

IF condition!

Hi everyone,

Is my below if condition proper?

I think m doing some mistake in 'and'!

Can anyone correct this condition?

IF(date1- date2 <= 30, 'Less Than 30',

IF(date1- date2 > 30 AND date1- date2 <= 45, 'Grace period',

if((date1- date2 >45,'Outside grace period'))) as Range_values ;

Thanks& Regards,

1 Solution

Accepted Solutions
aarkay29
Specialist
Specialist

IF(date1- date2 <= 30, 'Less Than 30',

IF(date1- date2 > 30 AND date1- date2 <= 45, 'Grace period',

if((date1- date2 >45,'Outside grace period'))) as Range_values ;

remove the extra '(' in the last line rest everything seems correct

View solution in original post

3 Replies
sunny_talwar

Looks right but can be shortened to this may be

IF(date1- date2 <= 30, 'Less Than 30',

IF(date1- date2 <= 45, 'Grace period', 'Outside grace period')) as Range_values ;

aarkay29
Specialist
Specialist

IF(date1- date2 <= 30, 'Less Than 30',

IF(date1- date2 > 30 AND date1- date2 <= 45, 'Grace period',

if((date1- date2 >45,'Outside grace period'))) as Range_values ;

remove the extra '(' in the last line rest everything seems correct

Karahs
Partner - Creator
Partner - Creator
Author

Thankyou Sunny T and Aar Kay , both conditions are working.