Happy Business Starts Here

Cumulative Sum of Invoice Items

Highlighted
Advanced Tutor

Cumulative Sum of Invoice Items

Hi, 

I am new to Workflow tasks, but this is what i was trying to achieve. I want to run through a set of Invoice Items and add the balances, and see if the balance is less than a Value. In Order to achieve this, I have initiated a Liquid variable before the iterate Invoice Items to 0 and Adding it after the iterate task in a Conditional Task using the below 

{% assign currentinvoicebalance = Data.Liquid.currentinvoicebalance | plus:Data.LinkData.Balance | plus:0.0 %}

However this currentinvoicebalance variable is only showing the 0 always for each iterate instead of keeping the running total. Any idea how this can be achieved? Thanks.

2 REPLIES 2
Highlighted
Master

Re: Cumulative Sum of Invoice Items

I suggest you achieve the cumulative sum of invoice items by using a Logic (Liquid) task and iterate through the collection of the data objects. 

 

Highlighted
Advanced Tutor

Re: Cumulative Sum of Invoice Items

Yes, ended up doing the same after some research.

I have to do a data query to get the invoice items i need, and then convert to JSON objects and then do the liquid, and then do the iterate of objects to achieve what I intended to do. Thanks for the reply, but i was wondering why this wasnt possible with simple data query and iterate.