data collection in automated indicator based on script

AndersBGS
Tera Patron
Tera Patron

Hi all, 

 

Currently trying to create an automated indicator which is based on a database view where incidents, problems and outages are clubbed together. Based on this database view, I would like to collect daily summarized outage duration. 

 

my script I have created is as follow:

var diff=function(x,y){return y.dateNumericValue() - x.dateNumericValue();};
var hours=function(x,y){return diff(x,y)/(60*60*1000);};
hours(current.Outage.Begin, current.Outage.End);

But I get below error in the pa job collector:

 

AndersBGS_0-1700735264245.png

From list view of the database view, this is how the refence is:

AndersBGS_1-1700735331450.png

Outage.Begin and Outage.end is OOTB fields with no changes. 

 

Anybody that can guide me in the right direction?

 

Best regards

Anders

 

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

0 REPLIES 0