1

I'm trying to convert this dataframe:

Dataframe1

into this dataframe in Knime

Dataframe2

Any suggestions?

Gábor Bakos
  • 8,982
  • 52
  • 35
  • 52
EricB
  • 11
  • 2

1 Answers1

1

(Assuming you do not know in advance the name of the last column.) I believe with my HiTS extension's Unpivot node it should work with a pattern like this (you will probably need a Column Renamer/String Manipulator to adjust it):

(q\d)(.*)

In case this is really just this single input, just use the Constant Value Column nodes to create the quarter, timing columns and the Column Rename/Column Resorter nodes to achieve the Dataframe2.

Gábor Bakos
  • 8,982
  • 52
  • 35
  • 52
  • Thank you for the quick reply Gábor. I can create the new columns for quarter, quantity and timing, but not sure how to populate them with the associated data that is laid out in "Dataframe2", specifically how to get the quantities out of the current q1beginningcount (grouped) column into the new "Quantity" column. I should add that i have 4 different timing categories and 4 quarters to work with. Plus many site IDs. – EricB Mar 23 '20 at 17:02
  • Well, first option. ;) (And probably you should [edit](https://stackoverflow.com/posts/60815779/edit) your question to help others give potentially better answers.) – Gábor Bakos Mar 23 '20 at 17:53