Use matrix table

Good morning,
I'm writing to you because I have a problem with use a matrix table-

This is my source table:

And for badge "0002" after use the action "pivot", I would expect to get 3 records:
BADGE E U
0002 2024-04-03 06:16:00 2024-04-03 12:14:00
0002 2024-04-03 12:58:00 2024-04-03 13:52:00
0002 2024-04-03 14:17:00 2024-04-03 18:07:00

Instead the result is only one record:

image

Please, Can you help me to get the desired result.

Thank you!

Hi Claudio,

You see only one row because pivoting is aggregation, and "Any" is the aggregation function that keeps one random value from a group of values.

In this case, grouping is done by the column [BADGE] because it's the only column that remains besides [DATA] and [E_U_G]. But since [BADGE] has only one value (0002) then the result is only one row.

You need to add another column for grouping to "explain" EasyMorph that rows 1 and 2 in the source dataset must become row 1 in the output. Rows 3 and 4 must become row 2, etc.

1, 2 -> 1
3, 4 -> 2
5, 6 -> 3
...

In this case, for one output row you will have exactly two values E and U (assuming E is in odd rows, and U in even rows for the whole dataset). Therefore, "Any" will do aggregation for exactly one value in each column and no value will be ignored.

You can do this by adding the "Enumerate rows" action, as below, and then removing the [RowNo] column, leaving only the [Repetition] column.