Progressive sum
I have a table with the 12 months of the year (12 records).
Inside I have a numeric field 'field A'.
Is it possible in each month to have a 'field B' field with the progressive sum of the 'field A' field so that if I enter the February record I only see the progressive sum of January + February?
thanks in advance
7 replies
-
I got this to work
I made a table with 12 records with the fields
Month Text
Order Number
A Number
B Formula
B contains the following formula
let a := Order;
sum((select Months where Order <= a).A)Regards John
-
This doesn't refresh as numbers in A change, so try making B a number and put this in the Trigger after update
let a := 0;
for j in (select Months) order by Order do
a := a + j.A;
j.(B := a)
end -
I honestly cannot understand the application of your code.
I try to repeat my situation.
I have a "Months" table which contains 12 records.
In each record I have:
- Text field with the name of the 'Month'
- Numeric field with the number of the month 'Month n °'
- Numeric field with a 'Budget €'
I should create a formula field that contains the running total of the 'Budget €' field -
let d := this;
sum((select Months where 'Month n°' <= d.'Month n°').'Budget €')Steven
-
BINGO!!
It works
Many thanks ;-)
p.s what is exactly the 'this' function? -
'this' tells Ninox to get the data of the current record you are on. you can then use any field from that record like Steven did in the second line: d.'Month n°'.
-
Many thanks to all ;-)
Content aside
- 3 yrs agoLast active
- 7Replies
- 591Views