Difference between ROWS based on conditions

KNIMERS,
I am struggling to find a way of finding the difference on the column
‘Sum(Qty)’

for those amouts that belong to the same:
‘Customer_Name’,
‘Item’
‘DD_YrMnth’

I have manually created column ‘Delta Column’ that provides the results that I need to program in KNIME.
Column G5, no operation needs to be done since its the first iteration of ‘QTY’ for that same ‘Customer_name’ & ‘Item’ & ‘DD_YrMnth’
Column G6 shows the result of D6-D5 which is zero
Column G7 shows the result of D7-D6
Finally, the process repeats itself for any “group” of ‘Customer_name’ & ‘Item’ & ‘DD_YrMnth’
Thank you in advanced for any suggestion on this.

Can you share some sample data? Is there a reason you’re using an unusual date format?

@rfeigel thanks for helping, I’m attaching a sample of my data. the screenshot above I created specifically to highlight my description,
but this is how it looks on my table

KNIME SHARED SAMPLE.xlsx (9.6 KB)

What version of Knime are you using? The data you uploaded isn’t the same as your screenshot. The upload has essentially no differences for Sum(Qty) row to row.

knime version is 5.4.1.

I am attaching a knime workflow with a wide data set, in the screenshot below im selecting rows of that table that, for the same date in DD_YrMnth (202409) have different amounts (150, 100 & 100), the expected result would be the difference between the first two amounts, and a second result with the


Sales Variance Table.knwf (252.5 KB)

I’m not 100% sure I understand what you’re after. Try this:

2 Likes

This is exactly what I needed. I am so grateful.

1 Like

Could you please mark solved.

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