Sum of the row counts

We have this code:


_**DETAIL FINANCIERING**_

|-----------18%---------------|---------------22%-----------:|---------------25%-----------:+
| Doel        |{% input custom.lening.doel%}||

<br>

|-----------20%---------------|---------------20%-----------:|---------------25%-----------:+
| Kapitaal        |{% $1+input custom.lening.kapitaal as:currency%}||
| Intresten        |_{% $2+input custom.lening.intresten as:currency%}_||
| TOTAAL        |{{ $1+$2 | currency }}||

<br>

|-----------20%---------------|---------------20%-----------:|---------------25%-----------:+
| Zijnde:          | {% input custom.lening.aantalmaalbedrag %} ||
| Eerste vervaldag:        |{% input custom.lening.vervaldag as:date%}||

<br>

|-----------25%---------------|---------------25%-----------:|---------------25%-----------:|---------------25%-----------:+
||_Kapitaal_|_Intresten_|_TOTAAL_

|-----------25%---------------|---------------25%-----------:|---------------25%-----------:|---------------25%-----------:+{% fori aflossingstabel in custom.leningen %}
|{% input aflossingstabel.jaarenaantalmaanden %}|{% if forloop.last %}_{% endif %}{% $10+input aflossingstabel.kapitaal as:currency %}{% if forloop.last %}_{% endif %}|{% if forloop.last %}_{% endif %}{% $20+input aflossingstabel.intresten as:currency %}{% if forloop.last %}_{% endif %}|{% if forloop.last %}_{% endif %}{{ $10+$20 | currency }}{% if forloop.last %}_{% endif %}{% endfori %}
| | **{{ $10 | currency }}** | **{{ $20 | currency }}** | **{{ $10+$20 | currency }}**

We get this result:

Is it possible to list the total of only one row instead of the sum of all previous rows in the last column?

Little reminder :blush:

Hi @Fiduciaire.Eulaers,

What exactly do you need? Depending on the date you’re in, it show the total of that row?

Or do you mean it like that :

_**DETAIL FINANCIERING**_

|-----------18%---------------|---------------22%-----------:|---------------25%-----------:+
| Doel        |{% input custom.lening.doel%}||

<br>

|-----------20%---------------|---------------20%-----------:|---------------25%-----------:+
| Kapitaal        |{% $1+input custom.lening.kapitaal as:currency%}||
| Intresten        |_{% $2+input custom.lening.intresten as:currency%}_||
| TOTAAL        |{{ $1+$2 | currency }}||

<br>

|-----------20%---------------|---------------20%-----------:|---------------25%-----------:+
| Zijnde:          | {% input custom.lening.aantalmaalbedrag %} ||
| Eerste vervaldag:        |{% input custom.lening.vervaldag as:date%}||

<br>

|-----------25%---------------|---------------25%-----------:|---------------25%-----------:|---------------25%-----------:+
||_Kapitaal_|_Intresten_|_TOTAAL_

|-----------25%---------------|---------------25%-----------:|---------------25%-----------:|---------------25%-----------:+{% fori aflossingstabel in custom.leningen %}
|{% input aflossingstabel.jaarenaantalmaanden %}|{% if forloop.last %}_{% endif %}{% $10+input aflossingstabel.kapitaal as:currency %}{% if forloop.last %}_{% endif %}|{% if forloop.last %}_{% endif %}{% $20+input aflossingstabel.intresten as:currency %}{% if forloop.last %}_{% endif %}|{% if forloop.last %}_{% endif %}{{ aflossingstabel.kapitaal+aflossingstabel.intresten | currency }}{% if forloop.last %}_{% endif %}{% endfori %}
| | **{{ $10 | currency }}** | **{{ $20 | currency }}** | **{{ $10+$20 | currency }}**

See what I did there?

By doing {% $10+input aflossingstabel.kapitaal as:currency %} the $10 will add the amount for every loop. The third column we don’t use those $10 and $ 20, but just the variables : aflossingstabel.kapitaal+aflossingstabel.intresten | currency

And in the last loop you’ll just show the total of $10 and $20.

Hope this is understandable; sorry we forgot about this post.

1 Like

It’s working! Thanks! :tada: