Hello guys !
My data are in a table where items are looking like
executionId - createdAt - type
The data are all events happening in our processes. So for a single executionId
there are multiple items. For example
ex123 - 2023-01-01T10:00:00.000 - workflowLambda
ex123 - 2023-01-01T10:00:10.000 - workflowTransform
ex123 - 2023-01-01T10:00:15.000 - workflowCatch
We are calculating the duration of each execution, using this calculated field
dateDiff(
parseDate(replace(firstValue(createdat, [createdat ASC], [actionid]), "Z", ""), "yyyy-MM-dd'T'HH:mm:ss.SSS"),
parseDate(replace(lastValue(createdat, [createdat ASC], [actionid]), "Z", ""), "yyyy-MM-dd'T'HH:mm:ss.SSS"),
"SS")
So we got in seconds the duration of the execution. But it is displayed on EVERY items of the execution. To hide them we created a calculated field
lead(createdAt,[createdAt ASC],1,[executionId])
That returns null for the last item of each execution, and added a filter to display in the table ONLY items that have null
in this calculated field.
So now we have a table where we’re seeing ONLY the last items for each execution, and it display the duration. That’s great.
But now we want a text insight where we’re just displaying the average duration for all executions. Basically doing a avg() or a sum()/count of all duration.
The thing is when i am using those 2 functions, it tells me that i can’t use both non aggregated and aggregated data, and i don’t really succeed to do it.
Can someone help me to obtain a SINGLE value of average duration for all my executions, with what i have already ?
Thanks a lot !!