thanks for the answer!
There are, however, several issues with this:
- I don't want to aggregate (which I'd do with a GROUP BY combined with a SUM? Otherwise, by what would I
need to group?)
- I cannot - or don't know how to - create the same thing using IFs: I want to make the display of fixed costs entirely independent of the date (DepDay) because the fixed costs come from an Excel table and they have no connection to the date, so originally, as soon as I selected one, they were ignored and that level was skipped. But I could drop that part of the formula and use that part in the diagram itself. It's actually only the variable_turnover_calculation that I want in the script.
Your last point is very good - all fields in the same table, that would mean I need a RESIDENT LOAD because I join that table with another one using a LEFT JOIN and in that second table, there's one field I use in my formula.