# Obtain opening value for a group of accounts

**URL:** <https://community.silverfin.com/t/obtain-opening-value-for-a-group-of-accounts/1244>\
**Category:** Templates\
**Tags:** filter\_collection, use\_case\
**Created:** [October 16, 2018, 3:01pm UTC](https://community.silverfin.com/t/obtain-opening-value-for-a-group-of-accounts/1244 "2018-10-16T15:01:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexandra](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@Alexandra](https://community.silverfin.com/u/Alexandra)\
**Post date:** [October 16, 2018, 3:01pm UTC](https://community.silverfin.com/t/obtain-opening-value-for-a-group-of-accounts/1244/1 "2018-10-16T15:01:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Sofie\_Cleemput](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sofie_cleemput/32/709_2.png) [@Sofie\_Cleemput](https://community.silverfin.com/u/Sofie_Cleemput)\
**Post date:** [October 17, 2018, 7:29am UTC](https://community.silverfin.com/t/obtain-opening-value-for-a-group-of-accounts/1244/2 "2018-10-17T07:29:45Z")

</div>

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) :

```auto
{% 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:

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

```

I hope this clarifies the matter.  
Kind regards

Sofie

---

<div class="post-metadata">

**Author:** ![Alexandra](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@Alexandra](https://community.silverfin.com/u/Alexandra)\
**Post date:** [October 17, 2018, 7:38pm UTC](https://community.silverfin.com/t/obtain-opening-value-for-a-group-of-accounts/1244/3 "2018-10-17T19:38:30Z")

</div>

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}}

---

<div class="post-metadata">

**Author:** ![Sofie\_Cleemput](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sofie_cleemput/32/709_2.png) [@Sofie\_Cleemput](https://community.silverfin.com/u/Sofie_Cleemput)\
**Post date:** [October 18, 2018, 9:22am UTC](https://community.silverfin.com/t/obtain-opening-value-for-a-group-of-accounts/1244/4 "2018-10-18T09:22:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [October 18, 2018, 9:26am UTC](https://community.silverfin.com/t/obtain-opening-value-for-a-group-of-accounts/1244/5 "2018-10-18T09:26:03Z")

</div>


