Obtain opening value for a group of accounts

I prepared a synthetic balance sheet which compares by main area amount of the period to the previous period.

For example {{#41|currency}} compared to {{#41:1y|currency}}

It works at year end.
But if I am working in an intermediary period for example 30/09/2018, I would like to compare 30/09/18 to 31/12/17,
but my formula compares 30/09/18 to 30/09/17.
How could I modify my formula to be sure to compare the period to the opening value ?

The formula #416000.opening_value works for a specific account but not for a group of accounts…
The following formula works for a group of accounts but not for opening value : {{ period.minus_1y.accounts | range:current_account.number }}

Thanks for your help.

Dear Alexandra

you are right that the opening.value doesn’t work for a group of accounts.
If you want to compare the period to the opening value in an intermediary period, you can use the following work around:

First you can create the collection of accounts (range) :

{% input custom.range.balance as:account_collection range:"1,2,3,4,5" default:"5" %}
{% assign balance_range = custom.range.balance | default:"5" %}

Then, calculate the opening value for the selected range:

{% assign accounts = period.accounts | range:balance_range %}
{{ accounts.opening_value }}

I hope this clarifies the matter.
Kind regards

Sofie

1 Like

Hi !

Thanks you for your answer and your help !

I found the following solution which allows me to modify my actual table without changing the structure of all the code :

I replaced {{#41:1y|currency}} by {{#41.include_zeros.opening_value|currency}}

Hi Alexandra

thanks for sharing this solution. This is definitely going to help other members of the community who will encounter the same issue in the future.

Kind regards
Sofie