Forum Discussion
powerquery m transfrom and reshape data (powerquery, transformation, data cleaning, data reshaping)
Hi Anonymous ,
Sorry I'm not very clear about your expected result. Here's the original data:
You want to get the time value of each procedure, which represent each procedure, would you like to explain more.
Best Regards,
Community Support Team _ kalyj
Yes sure, I need help in reshaping the data to get procedure, group and task time.
The raw data is like one record per row (header,value,header,value,header,value...)
in the below screenshot ProcedureId can be noticed in column E, G, M, S.... The same is with GroupId and TaskId (generated in dynamic columns in a row)
For a Task: there can be multiple tasks with the same flags/identifiers, following types are considered
- ExecutionEnteredTaskNode
- ExecutionTaskNodeWasEdited
- ExecutionExitedTaskNode
calculation logic is = ((ExecutionTaskNodeWasEdited with phase Skip - ExecutionEnteredTaskNode)+(ExecutionTaskNodeWasEdited with phase Skip - ExecutionEnteredTaskNode))
For a Group: there can be multiple groups with the same flags/identifiers, following types are considered
- ExecutionEnteredGroupNode
- ExecutionExitedGroupNode
calculation logic is = ((ExecutionEnteredGroupNode with CompletionStatus=Complete - The first ExecutionEnteredGroupNode after ExecutionResumed with CompletionStatus=Complete)+ (TerminalShutdown-The first ExecutionExitedGroupNode with CompletionStatus=Incomplete followed by ExecutionEnteredTaskNode))
For a Procedure: it includes both task and group time along with
- TerminalShutDown
- ExecutionResumed
calculation logic is = (TerminalShutDown-The first ExecutionEnteredTaskNode)+(TerminalShutDown-ExecutionResumed)+(TerminalShutDown-ExecutionResumed)....+(The last ExecutionExitedTaskNode-ExecutionResumed)
Merged columns in the screenshot show the task, group and procedure data occururances. Please let me know if this explains