Create a custom column on Platform Analytics to calculate the days difference from two date

davideluvotto
Tera Expert

Hi all,

 

Is there anyone who can suggest a method to add a custom column in Platform Analytics that calculates the difference between two dates?

For example, the difference in days between the opened date and the closed date of an Incident.

 

Thanks,
D

1 ACCEPTED SOLUTION

OlaN
Tera Sage

Hi,

A while back I made a tool to calculate the difference between two dates with Flow Designer.

Perhaps you can use it to set the value of a custom field in your table.

Ffor instance when an Incident is closed, the value would be set,

and then you can perform the reporting directly on that field.

View solution in original post

5 REPLIES 5

Hi @paulmagaling, unfortunately, there’s no update — it seems that it is not possible directly in Platform Analytics. Based on the information I have, Platform Analytics doesn’t support creating formula-based custom columns inside datasets.

The only workable approach is to calculate the value beforehand (for example, through a Business Rule or Flow Designer action) and store it in a dedicated field on the table. Then Platform Analytics can use that stored value for reporting.
The workaround we implemented is:

1. Create an integer field like:
u_resolution_days

2. Populate it using a Business Rule "On Close":

  • u_resolution_days = gs.dateDiff(opened_at, closed_at, true)
Hope it will be helpful.
Regards,
D