Expand my Community achievements bar.

The next phase for Workfront Community ideas is coming soon. Learn all about it in our blog!

Calculated Field to show day of year

Avatar

Level 8
I need to create a calculated field on a user custom form that calculates what day of the year it is and how much PTO is accrued up to that date. For example, today 11/16/2016 is day 320. I will be using this number to calculate PTO accrued, so for example it would be (Day of year x .44 hour). We would recalculate this field every morning so the PTO accrued number would be up to date. Fields I have: PTO Accrual Rate (this will be unique per employee depending on their years of service) Day of Year PTO Accrued (calculated based on PTO Accrual Rate x day of year)
Topics

Topics help categorize Community content and increase your ability to discover relevant content.

3 Replies

Avatar

Level 10
Hi Adina, I can't think of a way to do it automatically. There is DATEDIFF in a calculation but you can't use TODAY as an option. It needs to be a date on the object. If you have to have it and don't mind a manually process, here is my recommendation: Create a date custom field called something like Date for PTO Accural Create a calculated custom field called Day of Year where the equation is DATEDIFF(Date for PTO Accrual,"1/1/2016") Every day, just do a bulk edit of your users where you change the Date for PTO Accural Not fun as you have to update it every day, but is the best I could come up with. And actually, if you are going to bulk edit, it might be easier to just bulk edit the day of the year anyway. So maybe this isn't the best option. Hopefully this will trigger something for someone else and they will come up with a better idea for you. ;)

Avatar

Level 8
I finally figured out the calculation: DATEDIFF($$TODAY,$$TODAYby)+1 Thanks Doug and Anthony for your ideas!

Avatar

Level 10
Nicely done, Adina! And have you sorted out how to have it calculate each day (or whenever you need it)? Regards, Doug