How to dynamicaly calculate sum of all items?
Hi!
I'm new to podio. I was hoping to be able to use it for cash flow forecasting but I'm kind of stuck.
What I would like to ultimately do is show a graph of money balance over a 6 month future timeline.
So I have a Cash Flow app with @Amount and @Date of payment fields. What I need to do is calculate the sum of all the @Amount fields when @Date of current item > @Date previous items. Then I would use the calculation field to draw a graph.
Any ideas?
Thanks in advance!
-
You need a second app with an item to which all items of your Cash Flow app are related. There you can get the number in a calculation field
var amount = @Sum of amount; // from Cash Flow App var date = @all of date moment(date[date.length-1] > moment(String(date[date.length-2])) ? amount : ""
If date current item > date previous get sum of all amounts or show nothing (or whatever you want)
-
I'm still stuck with this.
To clarify, I only need calculation that would do this:
Item amount balance calc Item1 100$ 100$ Item2 -50$ 50$ Item3 10$ 60$
So what i need is sum of all previous items (or previous item calc + current item amount). Something as basic as this surely is possible, right?
-
Hi Jure,
For this to work in Podio, you need to connect the entries manually, e.g. Item2 needs to point to Item1, and Item3 needs to Point to item2. You do this with a relationship field. With this in place, you can use a calculation field like so:
@Sum of Balance + @Amount
Balance is the name of the calculation field.
Hope this helps!
Best,
Andreas -
Hello Jure,
calculation fields can be referenced like all other fields. But on "sum of ..." only normal number fields (incl. money) and calculation fields which are number type show up. Maybe the field you're looking for is text (string) type which you can only get by "all of ..." . If you want to use numbers from a text type calculation field for further calculations you have to parse it to number format first. Or you create a new calculation field (the one you're looking for) as number type.
Rainer
-
If you add the relationship-field as described earlier, it will work. The reference isn't pointing back to itself, but to the previous item in the chain so to speak. If Item2 points to Item1, then evaluating
@Sum of Balance + @Amount
for Item2 will be equal to100 + -50
, where100
is the balance from Item1 and-50
is the amount from Item2.
Please sign in to leave a comment.
Comments
9 comments