Quantities in monthly columns such as “2017-01-01”, 2017-02-01", etc. (up to “2022-12-01”)
As Step 1) I created new columns such as “MA(2017-06-01)” by means of the Moving Average Node for each UI. My UI is a concatenate of the 3 columns “Part Nr-StorageLocation-Site”.
As Step 2) for each UI, I would like to divide a column “MA(2017-10-01)” by “MA(2017-06-01)”.
For an example please look at the attached picture below (the input data can be found in the attached example file AverageMultipleColumns.zip (144.2 KB):
Hi,
you can use the math formula node for any mathematical expression.
//edit: Sorry, I misread that you need the column n-5. Let me think about that for a second…
Kind regards
Alexander
Hi again,
Could you use a column list loop start and then build the expression for the math formula node dynamically using a string manipulation node? The expression could then be passed to the math formula node using a flow variable. It’s not pretty, but should work ok.
Kind regards
Alexander
Hi Alexander,
Many thanks for your proposed solution. Unfortunately, I am not 100% sure how to implement what you’ve suggested. Could you do me the favor and re-explain/attach a workflow based on the one I’ve uploaded?
Thank you very much in advance and best regards,
Isabel
Hey, @izaychik63 had a really good suggestion with the column expression. I have created a small example workflow that demonstrate how it could be done. Please see attached workflow. Feel free to ask if you have any questions about it. It consists of a counting loop that loops through your columns. The column expression node uses the flow variable for the current iteration to access columns by index and calculates the difference between the columns at index “currentIteration + 1” and “currentIteration”. Then there are some nodes to create the names of the new columns and that’s it.
Kind regards
Alexander ColumnNum.knwf (23.9 KB)