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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
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
Partner - Champion III
Partner - Champion III

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.