Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Share your agentic AI experience, learn from others, and earn a new badge: Put Agentic AI to Work
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;

Labels (1)
4 Replies
sunny_talwar
MVP
MVP

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
MVP
MVP

less than 1 month??

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