Hey @sebcbon thanks for reaching out and being a part of the community! I’ve added triple backticks around your JSON so that everyone can better see your workflows.
For your specific case, have you tried using a single Edit Fields (Set) node instead of that branching if statement and doing the math there with a conditional set in the same expression? Then you can also remove the Merge node.
Thank you very much for your response.
Given that I am a beginner and unable to write a single line of code, I don’t know how to perform this sum in this specific case precisely. If you could assist me, that would be great. Best regards.
to provide further clarification regarding my previous messages, I am attempting to sum the two amounts in this column (to obtain their total), while retaining the other amounts that are also present in the same column (appended_SubRed_Amount). Is it clearer now ?
If you could provide some sample data in JSON format, it’d be easier for me to help you out if this doesn’t get you on the right track (as I obviously wouldn’t have access to your file), but I think what Ludwig was trying to say here was that you can use the Set node to do something like:
That would give you the sum no matter the amount of items in your array
First of all, a big thank you for your feedback and assistance.
I am attaching the test file and my latest workflow on the next message
What I am trying to achieve is:
1] Transform the TypeOpe amounts into negatives if they are in ROD.
2] Subtract (regardless of the amounts) the amounts with the same currency for each client (in this example: for client ‘CUST1,’ subtract -630000 $ (ROD) from 221000 $ (SOD) = -409000 $ (ROD). Please note that the actual amounts will vary each time.
I hope I have provided clear instructions, but feel free to ask if anything is unclear.
thank you so much, after tests it works well as I wanted it.
I just have an additional question: how i could make the other columns appears (Code Part, TypeOpe, etc) ? Because in this example at the end, only the columns “name”, “CCY” and “amount” appears and I need to have them all.