Calculate MTTP - Difference between proposed date and promoted date on major incident

pampapathi1
Tera Expert

Hi Team,

 

Can we create the DB view to calculate the MTTP , Please note that propose date is on child incident and promoted date is on parent incidents which is considered as major incident.

 

if not DB view is there any other way to build the report for MTTP.

 

 

Thanks in advance !!

 

Thanks,

Pampa

2 REPLIES 2

harish41
Tera Guru

Hi @pampapathi1 

I would have a BR Script on the child table where I calculate the date difference and then convert it into days/hours/minutes and store that information in a new variable so it can be used for reporting.

var startDate = new GlideDateTime(current.variables.proposed_date);
var endDate = new GlideDateTime(current.variables.parent_incident.promoted_date); //Note if there is a reference variable(parent_incident) referencing parent table  (or) get details of promoted_date by using Glide record.

var diff = gs.dateDiff(startDate.getDisplayValue(),endDate.getDisplayValue(),true); //This would return seconds
var days = diff/86400; //if needed convert the seconds to Days

 

Mark as correct and helpful if it solved your query.

Regards,
Harish






If my response has helped you, could you please mark it correct and close the thread so that it might benefit future readers.

Regards,
Harish