Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
WEBINAR April 23, 2025: Iceberg Ahead: The Future of Open Lakehouses - REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
Sai33
Partner - Creator
Partner - Creator

Difference between Dates in Load Script

Hello All,

I have my calender dates in the following format. I would like to generate a new column with the difference nbetween the two Date fields.

 

CDPD 
4375943594 
4375943616 
4375943669 

 

I would like the diff as a new field. My result table should look similar to the onw below.

CDPDAge
4375943594>150
4375943616100-150
437594366950-100

 

My load Script is as follows:

LOAD

[F2 Num],
[Current Date],
If([F2 Num]-[Current Date]<=2,'<=2 Days',
If([F2 Num]-[Current Date]>=3 and [F2 Num]-[Current Date]<=10, '3-10 Days',
If([F2 Num]-[Current Date]>=11 and [F2 Num]-[Current Date]<=30, '11-30 Days',
If([F2 Num]-[Current Date]>=30 and [F2 Num]-[Current Date]<=89, '30-89 Days',
If([F2 Num]-[Current Date]>=90 and [F2 Num]-[Current Date]<180, '90-180 Days',
If([F2 Num]-[Current Date]>=180, '>180 Days'

)))))) as Age

Thanks!

But, it doesn't work as expected.

 

 

Labels (1)
1 Solution

Accepted Solutions
Sai33
Partner - Creator
Partner - Creator
Author

Solved via Nested IF.

View solution in original post

1 Reply
Sai33
Partner - Creator
Partner - Creator
Author

Solved via Nested IF.