Making totals in tables

I want to make a total for each month for these input field. There are too many to work with $. How can this be solved?
|{% input custom.mei.vak59 as:currency %}
|{% input custom.mei.vak62 as:currency %}
|{% input custom.mei.vak64 as:currency %}
|{% input custom.mei.vak55 as:currency %}
|{% input custom.mei.vak56 as:currency %}
|{% input custom.mei.vak57 as:currency %}
|{% input custom.mei.vak54 as:currency %}
|{% input custom.mei.vak61 as:currency %}
|{% input custom.mei.vak63 as:currency %}
|{% assign controle = custom.mei.vak59+custom.mei.vak62+custom.mei.vak64-custom.mei.vak55-custom.mei.vak56-custom.mei.vak57-custom.mei.vak54-custom.mei.vak61-custom.mei.vak63 | currency %}

Hi Sylvia,

If I understand your question correctly, you want to sum some input values and deduct some input values. This can be done by using two registers, one for the values to sum up and one for the values to deduct. You’re code would than look like this:

|{% $1+input custom.mei.vak59 as:currency %}
|{% $1+input custom.mei.vak62 as:currency %}
|{% $1+input custom.mei.vak64 as:currency %}
|{% $2+input custom.mei.vak55 as:currency %}
|{% $2+input custom.mei.vak56 as:currency %}
|{% $2+input custom.mei.vak57 as:currency %}
|{% $2+input custom.mei.vak54 as:currency %}
|{% $2+input custom.mei.vak61 as:currency %}
|{% $2+input custom.mei.vak63 as:currency %}
|{{ $1-$2 }}

Hi Michiel

This works voor the horizontal totals. However we also need totals for the vertical columns.


Hey @sylvia.debaeremaeker,

We have a standard template called “omzetvergelijking” that does this. The source code is available, but something tells me you want to tweak this?

Could you explain to me why you want a user to input all those fields again in another template, if our standard could also be used for that? We might found a workaround for this, by adding your “controle” in the extra configuration box of the standard template?

Hi Sven

Because we want information in fields 59 - 64.

  • total for payed TVA
  • total for deducted TVA

Hi @sylvia.debaeremaeker,

Then why not add this function to the standard template of turnover comparison?

All input fields are generated like this:

{% assign period = custom.periods[forloop.index] %} 

{%=$1+input period._00 as:currency placeholder:'' %} 

meaning, that the name of the custom variable of the first month or quarter is:

{{ custom.periods[1]._01 }}

For the second month/quarter it’s

{{ custom.periods[2]._01 }}

And so on…

You could add this to the extra configuration box in the template:

In there, you could add following code perhaps (just a simple example):

{% assign total_01 = custom.periods[1]._01+custom.periods[2]._01+custom.periods[3]._01+custom.periods[4]._01+custom.periods[5]._01+custom.periods[6]._01 %}

{% ic %}
The total of R01 is {{ total_01 | currency }}
{% endic %} 

which would result to this:

This way, you don’t need to remake another template and you can still use our standard template.

Let me know if this works out for you!