Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
Qlik Connect 2025! Where innovative solutions turn your data visions into reality: REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get days in due in table box?

Hi,

I have table box with data. How can I calculate the Days in Due. I have to use the below formula in table box. can anyone suggest me please.

Days in due = =Days360(Today(), RecentDate)

Thanks.

11 Replies
Not applicable
Author

please see attached.

Anonymous
Not applicable
Author

Hi,

Try Below,

Interval(Today()-RecentDate, 'DD') as DueDays

Not applicable
Author

Thanks. How can I get values for RecentDate only from 01  May2014 to 31 July 2014. I,e how can I write this in script. Please suggest.

Anonymous
Not applicable
Author

Hi,

You can write IF condition inside interval function. Something like below,

Interval(Today()-If(Match(Month(RecentDate), 'May', 'Jun', 'Jul'), RecentDate), 'DD') as DueDays

Not applicable
Author

Thanks. The above is for example three months. I need to show the table box values automatic every time between four months. I,e from two months before to next month. How can I change the expression. please suggest.

I,e for eg: RecentDate should be between May and August

EDIT: I tried above expression but the values are showing blanks.

Anonymous
Not applicable
Author

Try below,

Interval(Today()-If(Match(Month(RecentDate), Month(AddMonths(Today(),-2)), Month(AddMonths(Today(),-1)), Month(AddMonths(Today(),0)), Month(AddMonths(Today(),+1))), RecentDate), 'DD') as DueDays

Anonymous
Not applicable
Author

See the attached file. Let me know if you still facing issue.

Not applicable
Author

Thanks. How can I write the script to get RecentDate for same range? I,e from two months before to next month

please suggest.

Anonymous
Not applicable
Author

Hi,

Try below,

If(RecentDate>=MonthStart(AddMonths(Today(),-2)) And RecentDate<=MonthEnd(AddMonths(Today(),+1)), RecentDate) as RecentDate

Even you can use part of DueDays script as RecentDate (See below script in bold)

Interval(Today()-If(Match(Month(RecentDate), Month(AddMonths(Today(),-2)), Month(AddMonths(Today(),-1)), Month(AddMonths(Today(),0)), Month(AddMonths(Today(),+1))), RecentDate), 'DD')