Forum Discussion
marciocampos
7 years agoRegular Visitor
How to aggregate values in 2 dimensions
hi folks! I need some help here !! Someone could help me? :) I have a table with "test records" and I need to extract from it the "test total duration" and "days worked per test wave". See th...
- 7 years agoIt's Working !!! Thank you very much darlove !!!
AUaero
Responsive Resident
7 years agoWhy not create a calculated column to calculate the days between start and finish for each row? Working Days would be the sum of the the calculated column.
marciocampos
7 years agoRegular Visitor
This is not possible because we can have 2 tests performed on the same day and in this situation we have counted only 1 working day and not 2. See the example below:
| Region | Wave | Test Name | Start | Finish |
| RJ | 1 | A | 17/07/2019 | 18/07/2019 |
| RJ | 1 | B | 17/07/2019 | 18/07/2019 |
| RJ | 2 | A | 25/07/2019 | 26/07/2019 |
Working Time (RJ) = (18/07/2019 - 17/07/2019) + (26/07/2019-25/07/2019) = 2 days
- Anonymous7 years agoNot applicable
[Working Time] =
var __onlyOneRegionVisible = hasonevalue( T[Region] )
var __differentTimeBounds =
summarize(
T,
T[Start],
T[Finish]
)
var __workingTime =
sumx(
__differentTimeBounds,
T[Finish] - T[Start]
)
return
if(
__onlyOneRegionVisible,
__workingTime
)Best
Darek
- marciocampos7 years agoRegular VisitorIt's Working !!! Thank you very much darlove !!!