Table Transformation Issues

I’m trying to take a table and split the columns into rows in a very specific way. I have tried using the Unpivoting node without success. Any suggestions as to the best way to approach this problem?
I’m trying to take this:
Date X Y
2013/1/13 50 30
2014/2/4 44 22
2015/4/15 23 88
2016/3/27 47 99

To this:
Jan Feb Mar Apy
2013 X 50 0 0 0
2013 Y 30 0 0 0
2014 X 0 44 0 0
2014 Y 0 22 0 0
2015 X 0 0 0 23
2015 Y 0 0 0 88
2016 X 0 0 47 0
2016 Y 0 0 99 0KNIME_Example.knwf (44.4 KB)

Your WF does not have saved data. Anyway, you correctly assumed that you need unpivot X and Y values. After this you need extract year and month from the date and pivot result using month as pivoting column.

1 Like

Here’s a workflow that does pretty much what @izaychik63 suggested, with a bit of additional cleanup.

2019-04-10%2015_38_00-Output%20table%20-%203_7%20-%20Missing%20Value%20(Replace%20missing)

UnpivotDateExtractRepivot_Example.knwf (18.4 KB)

4 Likes

That’s a much easier way of doing that! Thank you both for the assistance.

3 Likes