Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
karan_kn
Creator II
Creator II

Flag dates in load script

Can someone help me if the condition is not coming under this (1 to 60 months, it must be less than 1 month) how to flag that one?

T1:

LOAD *,

IF(MonthDiff >= 1 AND MonthDiff <= 12, 'Flag1',

IF(MonthDiff >=13 AND MonthDiff <= 36, 'Flag2',

IF(MonthDiff >=37 AND MonthDiff <= 60, 'Flag3','Flag4'))) AS Status;

4 Replies
sunny_talwar

Isn't Flag4 what you want? It would include anything less than 1 month and greater than 60 months

aarkay29
Specialist
Specialist

IF(MonthDiff >= 1 AND MonthDiff <= 12, 'Flag1',

IF(MonthDiff >=13 AND MonthDiff <= 36, 'Flag2',

IF(MonthDiff >=37 AND MonthDiff <= 60, 'Flag3',

IF(MonthDiff =0 , 'Flag4')))) AS Status;

the expression that you are using would give Monthdiff<1 or monthdiff >60 for 'Flag4' use this instead

karan_kn
Creator II
Creator II
Author

less than 1 month

sunny_talwar

less than 1 month??

are you going to write more than this or that was it