# Calculation ratio

**URL:** <https://community.silverfin.com/t/calculation-ratio/493>\
**Category:** Templates\
**Tags:** references, drops, drop\_period\
**Created:** [November 14, 2017, 3:23pm UTC](https://community.silverfin.com/t/calculation-ratio/493 "2017-11-14T15:23:52Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![svalais](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/svalais/32/2422_2.png) [@svalais](https://community.silverfin.com/u/svalais)\
**Post date:** [November 14, 2017, 3:23pm UTC](https://community.silverfin.com/t/calculation-ratio/493/1 "2017-11-14T15:23:53Z")

</div>

Hallo,

We have manual input fiels in a document for the calculation of the ratio’s.

In the document, you can find a example of the manual input and also the code.

My question is how can I make a rollover of the manual input from one year to the another year?

Thanks,

Sylvie

---

<div class="post-metadata">

**Author:** ![SamVanEenoo](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/samvaneenoo/32/134_2.png) [@SamVanEenoo](https://community.silverfin.com/u/SamVanEenoo)\
**Post date:** [November 14, 2017, 3:49pm UTC](https://community.silverfin.com/t/calculation-ratio/493/2 "2017-11-14T15:49:48Z")

</div>

Hey Sylvie

Is it necessary that the calculation of the ratio’s is made in a document?  
You can probably just paste your code into a reconciliations template and use the copy details button to transfer your manual input data to the next year.

Kind regards

Sam

---

<div class="post-metadata">

**Author:** ![svalais](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/svalais/32/2422_2.png) [@svalais](https://community.silverfin.com/u/svalais)\
**Post date:** [November 15, 2017, 7:18am UTC](https://community.silverfin.com/t/calculation-ratio/493/3 "2017-11-15T07:18:11Z")

</div>

Hallo Sam,

I made a try with your solution and the copy details button copied the information of the column 2016 in the column 2017. This is not correct.

Thanks,

Sylvie

---

<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:** [November 15, 2017, 7:41am UTC](https://community.silverfin.com/t/calculation-ratio/493/4 "2017-11-15T07:41:41Z")

</div>

Morning @svalais,

Is this not the same request as [this](https://community.silverfin.com/t/template-annex-to-the-table-of-taxed-reserves/429/3) by any chance?

And if so, where are you stuck?

---

<div class="post-metadata">

**Author:** ![svalais](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/svalais/32/2422_2.png) [@svalais](https://community.silverfin.com/u/svalais)\
**Post date:** [November 15, 2017, 7:55am UTC](https://community.silverfin.com/t/calculation-ratio/493/5 "2017-11-15T07:55:57Z")

</div>

Hallo Sven,

This is the same thing but in a document and not in a disclosure.

See the print screens in my first question.

Thanks,

Sylvie

---

<div class="post-metadata">

**Author:** ![SamVanEenoo](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/samvaneenoo/32/134_2.png) [@SamVanEenoo](https://community.silverfin.com/u/SamVanEenoo)\
**Post date:** [November 15, 2017, 8:35am UTC](https://community.silverfin.com/t/calculation-ratio/493/6 "2017-11-15T08:35:37Z")

</div>

Hi Sylvie

We are not able to see the print screen for some reason.  
Can you however post your code, so we can have a look at it?

Kind regards

Sam

---

<div class="post-metadata">

**Author:** ![svalais](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/svalais/32/2422_2.png) [@svalais](https://community.silverfin.com/u/svalais)\
**Post date:** [November 15, 2017, 12:06pm UTC](https://community.silverfin.com/t/calculation-ratio/493/7 "2017-11-15T12:06:36Z")

</div>

Hi Sam,

In the document in annex, you will see the different print screens and the code.

Thanks,

Sylvie

---

<div class="post-metadata">

**Author:** ![SamVanEenoo](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/samvaneenoo/32/134_2.png) [@SamVanEenoo](https://community.silverfin.com/u/SamVanEenoo)\
**Post date:** [November 15, 2017, 1:00pm UTC](https://community.silverfin.com/t/calculation-ratio/493/8 "2017-11-15T13:00:39Z")

</div>

Hi Sylvie

Could you please post the code in this thread itself?  
Since, unfortunately, there is no way for me to see your annex.

Kind regards

Sam

---

<div class="post-metadata">

**Author:** ![svalais](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/svalais/32/2422_2.png) [@svalais](https://community.silverfin.com/u/svalais)\
**Post date:** [December 12, 2017, 2:59pm UTC](https://community.silverfin.com/t/calculation-ratio/493/9 "2017-12-12T14:59:00Z")

</div>

Hi Sam,

This is the code:

_{% hideunlessi false %}|Manual input for the calculation of the ratio_  
_|--------------------------------------------|-----15%---------------------------------------:|-----------15%------------------------------------------{% if previous\_period2.exists %}:|--------------15%-----------------------------------------{% endif %}{% if previous\_period3.exists %}:|--------------15%-----------------------------------------{% endif %}{% if previous\_period4.exists %}:|--------------15%-----------------------------------------{% endif %}:+_  
_|Average number of employees (FTE) | {% $0+input custom.ratio.VTE\_CY as:currency placeholder:’’ %} | {% $1+input custom.ratio.VTE\_PY as:currency placeholder:’’ %} {% if previous\_period2.exists %}|{% $2+input custom.ratio.VTE\_PY\_1 as:currency placeholder:’’ %}{% endif %} {% if previous\_period3.exists %}|{% $10+input custom.ratio.VTE\_PY\_2 as:currency placeholder:’’ %}{% endif %} {% if previous\_period4.exists %}|{% $11+input custom.ratio.VTE\_PY\_3 as:currency placeholder:’’ %}{% endif %}_  
_|Number of actual achieved hours employees (= code 101 social balance sheet) | {% $3+input custom.ratio.uren\_CY as:currency placeholder:’’ %} | {% $4+input custom.ratio.uren\_PY as:currency placeholder:’’ %} {% if previous\_period2.exists %}|{% $5+input custom.ratio.uren\_PY\_1 as:currency placeholder:’’ %}{% endif %} {% if previous\_period3.exists %}|{% $12+input custom.ratio.uren\_PY\_2 as:currency placeholder:’’ %}{% endif %} {% if previous\_period4.exists %}|{% $13+input custom.ratio.uren\_PY\_3 as:currency placeholder:’’ %} {% endif %}_  
_|Number of actual achieved hours temp. staff (= code 151 social balance sheet) | {% $6+input custom.ratio.interim\_CY as:currency placeholder:’’ %} | {% $7+input custom.ratio.interim\_PY as:currency placeholder:’’ %} {% if previous\_period2.exists %}|{% $8+input custom.ratio.interim\_PY\_1 as:currency placeholder:’’ %}{% endif %} {% if previous\_period3.exists %}|{% $14+input custom.ratio.interim\_PY\_2 as:currency placeholder:’’ %}{% endif %} {% if previous\_period4.exists %}|{% $15+input custom.ratio.interim\_PY\_3 as:currency placeholder:’’ %}{% endif %} {% endhideunlessi %}_

Thanks,

Sylvie

---

<div class="post-metadata">

**Author:** ![svalais](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/svalais/32/2422_2.png) [@svalais](https://community.silverfin.com/u/svalais)\
**Post date:** [December 12, 2017, 2:59pm UTC](https://community.silverfin.com/t/calculation-ratio/493/10 "2017-12-12T14:59:46Z")

</div>

Hello,

Do you have already a look on my problem?

Thanks,

Sylvie

---

<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:** [December 13, 2017, 8:59am UTC](https://community.silverfin.com/t/calculation-ratio/493/11 "2017-12-13T08:59:48Z")

</div>

Hello @svalais,

I think you’ll need to change your code to something like this (it’s stripped and not all your code is there, to make it more clear for you):

```auto
{% assign previous_period = period.minus_1y %}

{% stripnewlines %}
{% newline %}
  {% hideunlessi false %}
  Manual input for the calculation of the ratio
{% newline %}
{% newline %}
  |--------------------------------------------
  |-----15%------------------------------------:
  |-----------15%------------------------------:+
{% newline %}
  | Average number of employees (FTE) 
  | {% $0+input period.custom.ratio.VTE_CY as:currency placeholder:’’ %}
  | {% if previous_period.exists %}
      {% $1+input period.custom.ratio.VTE_PY as:currency default:period.minus_1y.custom.ratio.VTE_CY %} 
    {% else %}
      {% $1+input period.custom.ratio.VTE_PY as:currency placeholder:’’ %} 
    {% endif %}
  {% endhideunlessi %}
{% endstripnewlines %}

Saldo : {{ $1 | currency }}

```

So, your custom objects need to change to `period.custom`, otherwise you will not be able to get the info from the object from previous period, if it exists.

So, if the previous period exists, we’ll add a default. Which default?

This one :

```auto
period.minus_1y.custom.ratio.VTE_CY

```

Can you go with this @svalais ? So you’ll definitely need to change your objects and attach it to the period-drop.
