Turn column format into row format

Hello,

In my workflow I want to insert a node bar chart to compare the number of players in each country (see image “excelV1” for data.

The problem is that I have no column to identify so I would like to transform my “excelV1” data into “excelV2” in order to clearly identify the 2 columns.
excelV2

workflow:
workflowPredict

Thanking you in advance.

Thank you in advance,
Tom

1 Like

Hi @Thimi91

I believe this could be done using a -Transpose- node and then a -Column Rename- node to get the columns named as “nationality” and “players”.

Hope it helps.

Best

Ael

1 Like

Hi @aworker ,

I had tried this before because someone had given this as a solution but the problem is that the row “RowID” does not count as a column.
Column rename
Nodes

Hi @Thimi91

Once the table is transpose, to get the information out of the RowID, a solution is to use the -RowID- node which has an option to create a new column (here the name would be “nationality”) with the content of the RowID column.

After that, if you need to resort the columns, please use the -Column Resorter- node and finally, the -Column Filter- node if you need to filter any column before saving the results in your Excel file.

Hope this helps :wink:

Best

Ael

2 Likes

Thank you very much with all these manipulations it finally works.
Finally in addition to this problem is that my column “players” was tpe string instead of number .


The beginner that I am did not see this error.

Best regards,

Tom

1 Like

Hi @Thimi91

Glad it worked and no worries at all, we are all more or less beginners :wink:

Maybe you would like to remove the “sum()” string from the “Nationality” column. For that, there is an option in the -GroupBy- node which allows to keep original names for aggregated columns:

Hope this helps too and thanks for having validated the solution.

Best wishes

Ael

Yes indeed this is something I would have liked to do but it would imply that I modify all the parameters of my “java snipped” node.

I’ll be more careful next time.

Thanks again @aworker

1 Like

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