Transform a table

Hello,
I have a table like
id date role
1 2007 10
1 2019 11
2 2008 20
3 2005 30
3 2007 31
3 2018 32

I want to transform this table so as I can see unique id and append columns as much as the id is repeated
example :
id date1 role1 date2 role2 date3 role3
1 2007 10 2019 11 - -
2 2008 20 - - - -
3 2005 30 2007 31 2018 32

Any help , thank you a lot !

Use


with grouping on id, pivoting on date and list/first/last aggregation on role.

2 Likes

Thanks for your response, but I want also date as data not a pivot !

Hi @Abdessamad7

I created a workflow transform_a_table.knwf (37.4 KB) which I think does the job. Hope this helps.

gr. Hans

2 Likes

Hi there @Abdessamad7,

In order to use only Pivoting node as suggested by @izaychik63 you should add additional column that will be Pivot column:

TableForPivoting

To create this column you can modify solution provided by @HansS in this topic:

Br,
Ivan

1 Like

Thank you so much it was very helpful

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.