You can use “One to Many” node for this.
The output will be the same as you want except for the “Yes/No” values which will be “1/0” in this case but you can edit them and change the values from 1/0 to Yes/No later.
Thank you, and sorry about the confusion. Actually I would need to calculate exactly if the client is new or existing client when based on their purchase year, and I am using the rule engine. (first purchase year = purchase year => “New”).
I would like to get the results like this, so i can summarize how many new and existing clients for each year.
After the “One to Many” node we have a “Column List Loop Start” to loop over each year column and a “Column Expressions” to assign the value “New/Existing”. After the loop end we have a “Column Filter” node to exclude the duplicates of the first 3 columns(using regex).
Please let me know if this is what you need: oneToMany.knwf (28.4 KB)
Best,
Armin
P.S. To have the year columns in order, you can use a “Sorter” node to sort rows based on the “purchase year” and then a “Domain Calculator” node (for the same column) just before the “One to Many” node.