How do I derive the quarter of any given date?

hemnath
Kilo Contributor

I am trying to create a Pivot Table with Incidents created for each assignment Group for every Quarter of a year.

 

Since i want the detailed report i dont want to use the Trend chart which give the option to diplay the result in Quarter.

 

 

regards,

Hemnath

1 ACCEPTED SOLUTION

jcraneNYC
ServiceNow Employee
ServiceNow Employee

A couple suggestions would be to:


  • Create a field on the incident that contains the numeric value of the quarter derived from Javascript.
  • Create a metric that captures the same thing when an incident is created. This gets you out of creating a custom field but only technically starts recording data from the date the metric was created.

View solution in original post

3 REPLIES 3

jcraneNYC
ServiceNow Employee
ServiceNow Employee

A couple suggestions would be to:


  • Create a field on the incident that contains the numeric value of the quarter derived from Javascript.
  • Create a metric that captures the same thing when an incident is created. This gets you out of creating a custom field but only technically starts recording data from the date the metric was created.

Jon




  • Create a field on the incident that contains the numeric value of the quarter derived from Javascript.

,


This option works and for all the newly created Incidents i was able to get the Quarter value,


I tested it with 2 options,


1.Entry in dictionary with the calculation to identify the quarter.  


2.Entry in dictionary without calculation but with a Business Rule to identify the quarter.(One of my colleague helped me on using Business rule)



Now pending is to update the the Incidents which were created prior to the above change, once i finish that i will update you.



Thanks for your help and i am yet to explore your second option.



regards,


Hemnath


hemnath
Kilo Contributor

update via "Script Background" was successful and now I have the Quarter column value for old and newly created Incidents



regards,


Hemnath