Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Adding dynamic duration column on report

manirathore
Tera Contributor

I have one report in which user information is there. I want to add one column for the duration(in years and months) the user has been with the company and that should be dynamic.

4 REPLIES 4

Ankur Bawiskar
Tera Patron

@manirathore 

if you are using standing reporting then you can use a function field which stores the difference between now time and sys_created_on

see this link

Function Fields in ServiceNow Reports: Calculate and Display Data on the Fly 

see this gif which helps you

AnkurBawiskar_0-1765955105260.gif

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

manirathore
Tera Contributor

there is one field in the user table called hire date. i want to get the duration of the hire date till today dynamically. how can i do that?

Servicenow reporting is great at displaying data - but it's purpose is not to calculate it...it's not excel.

 

If it were me, here are the things I'd try:

  • Chunking instead of calculating  - throw it on a bar graph with a bar for hire date less than 1 year ago, hire date 1-5 years ago, 5-10 years ago, and 10+ years ago - or whatever makes sense for your team.
  • Collaborate with your platoform team to calculate the data - perhaps as a calculated column on the user table or something that makes sense for your team. 
  • Create a function field as Ankur suggested above - but those are a drag on performance for any query on the table so i would not suggest it unless you have a very small table that is not queried often

@manirathore 

the link and approach I shared will work for you.

I informed to use Created on date, you can use your Hire date instead of that

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader