Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

Date Difference

I have following script to  calculate the Days_left

num(makedate(2014,8,31))>0, num(POL_PERIOD_TO)- num(makedate(2014,8,31)),0) as DAYS_LEFT

The resulting table is as follows and Total of Days_Left sum to 636 where as Actual number of Days_left is 212

How can I restrict the No of Days_left appear as 212 (modification to Script)

POLICY_NOPOL_PERIOD_FROMPOL_PERIOD_TORISK_DATEDAYS_LEFT
NC5231-Mar-201431-Mar-201531-Mar-2014212
NC5231-Mar-201431-Mar-201512-Aug-2014212
NC5231-Mar-201431-Mar-201511-Aug-2014212
Total 636
2 Replies
geert_gelade
Creator
Creator

If I understand your question, you want to show 212 in the resulting table instead of 636.

In that case you can just change the Total Mode to "max" on the Expressions tab of you table.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try Interval() to get the date difference

=Interval(POL_PERIOD_TO - makedate(2014,8,31), 'D')

OR

Num(POL_PERIOD_TO) - makedate(2014,8,31)


Hope this helps you.


Regards,

Jagan.