Help: list of properties and values converted to separate column

Hi! I hope somebody can help me with this.

I have a list of items, each with a set of properties. Right now they’re all listed in 2 columns: property in left column, value in right column. All items listed under each other.
I want every item to be 1 row, with the properties in the columns. The values per property fill the data field. I hope the image I attached clears it up. (What I have is left, what I want is right)

How can I do this?
Thanks so much!!

knime help|617x364

Hi @Reinoud -

Can you try posting the image again? For some reason it’s not showing up.

Hi Scott, thanks for your reply. I don’t seem to be able to edit my initial post, so here I uploaded the image again:

Imgur

Here’s what I would do:

  • First fill in the missing values in your Item column - which you can do with the Missing Value node with the Previous Value option.

  • Then you can use the Pivoting node, grouping on Item and pivoting on Property, with an appropriate aggregation (I think both First or Sum would work here). Then check the top output port for the pivoted results.

Here’s an example workflow that shows various ways to use the Pivoting node if you need an example: https://kni.me/w/6OPrrabTBNBanSd5

3 Likes

Thanks Scott, I was indeed struggling getting the pivoting right but I managed with your help!

2 Likes

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