Please please teach me how to solve this loop Problem!

Hi Guys,

I am trying to figure out how to build Loop flow to organize my monthly shipment data side by side as below.
Is there any Knime God to help for sharing the work flow?

Data

|Month | Customer | Item | Qty|
|— | — ----------- | — ---- | —|
|Jan | Tom | A | 1|
|Feb | Tom | A | 1|
|Feb | Tom | B | 2|
|Mar | Tom | A | 5|
|Mar | Tom | C | 2|

Result

|Customer | Item | Jan | Feb | Mar|
|— ------------ | ------- | ------ | ------ | ------|
|Tom | A | 1 | 1 | 5 |
|Tom | B | | 2 | |
|Tom | C | | | 2 |

Knime Problem.xlsx (10.2 KB)

Hey there and welcome to the forum,

happy to help you out here - you can solve this with one node - the pivot node:

  1. Group by Month + Customer
  2. Pivot Item - select “Pivot name” as column name (works as long as you only have one aggregation)
  3. Aggregate QTY using Sum

See screenshots here:

Result:

Workflow:
shipmentunpivot.knwf (82.6 KB)

4 Likes

Oh my god!
Thank you so much.
I always thought that it must be done with loop work flow.
I never try to use pivot node.
Thank you so much. Really appreciate!
You made my day perfect!

you are welcome!

If this solved the issue please flag as solution so that future users with similar problems can find it quicker!

2 Likes

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