You are going to need to create another field and use that field for the reporting instead of the duration field. I'd recommend adding a new number field, set a default value of 0, and set the round rule to up. Make the number field a formula field and set it to be an extended formula. Then it is just a matter of building a formula to calculate the number of days in the duration field. The duration is stored in the database as long value, so it is just a number which means we can use math against it.
Here is the basic format of how a duration field is calculated:
(100000000000000 * ((years * 12) + months)) + (weeks * 604800000) + (days * 86400000) + (hours * 3600000) + (minutes * 60000) + (seconds * 1000) + milliseconds
A year is equal to 365 days in milliseconds. A month is equal to 365 days in milliseconds divided by 12.
So, what you need to do is take the duration field which is stored in milliseconds and calculate the number of days based on that. The formula is going to get rather complicated as you pull out the various parts and convert them to days.
Good luck
--Mark
------------------------------
Mark Johnson
Senior Architect
Wipro
------------------------------
Original Message:
Sent: Mon September 19, 2022 04:31 PM
From: Mike A
Subject: Question regarding converting duration data fields
I have a need to create a report displaying a duration data field but only listing the number of days (instead of days, weeks, months, etc.) and rounding up any duration value less than one day to display as one day (so 1 day 1 hour would display as 2 days). Does anyone have any insight on best way to go about this? Does anyone know of any existing configuration examples I could reference in OOB TRIRIGA or even online somewhere where a duration data field is converted to report the number of days only?
P.S. If you are curious the specific duration field I need to convert for our business users is the triActualDU field in triTask / triScheduleTask.
------------------------------
Mike A.
------------------------------
#AssetandFacilitiesManagement
#TRIRIGA