Pivoting reordering columns

I’m Pivoting the results of a GroupBy (results of which in attached CSV). Group is “AffectedType”, Pivots is “Year” and Aggregation is “First Count(CVE)”. It does what I expected except that the second row (with Year=1989) becomes the LAST rather than the Second column.

Is this expected behaviour? KNIME 3.6.1.exmpl.txt (1.2 KB)

The year 1989 becomes the last column because there is not the combination AffectedType=a (the first grouping value) and year=1989 in the data. To fix this:

  1. Add Domain Calculator node to your workflow before the Pivoting node and include the column Year in the configuration window.
  2. Uncheck “Ignore domain” in the Pivots tab in the configuration window of the Pivoting node.
1 Like

Perfect! Thank you Maarit :slightly_smiling_face:

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