Calculating # of hours between 2 dates from all rows in query

I have a query that returns a list of jobs. Each job has a start and end timestamp. I want to calculate the total number of hours between each start and end timestamp. I think my JS is correct but I'm struggling on figuring out where to actually put this JS. Since I'm actually doing a calculation and returning a value, it doesn't seem like I can just put {{ my code }} in the Value: field of the component that's supposed to display the number.

let hours = 0;
for (let i = 0; i < {{showJobs.data.length}}; i++){
  hours = hours + (Math.abs({{showJobs.data.job_start[i]}} - {{showJobs.data.job_end[i]}}) / 36e5);
return hours;
}

Hey @elliotmersch!

You might try using a standalone transformer for this:

You should be able to copy the code you have in and then reference {{yourTransformer.value}} in the component you'd like to display the sum in.

Let us know if that works?