# Rollforward to the following five years if a certain variabel is greater than 0

**URL:** <https://community.silverfin.com/t/rollforward-to-the-following-five-years-if-a-certain-variabel-is-greater-than-0/1817>\
**Category:** Templates\
**Tags:** rollforward\
**Created:** [June 12, 2020, 8:46am UTC](https://community.silverfin.com/t/rollforward-to-the-following-five-years-if-a-certain-variabel-is-greater-than-0/1817 "2020-06-12T08:46:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emmy\_Pettersson](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/emmy_pettersson/32/1335_2.png) [@Emmy\_Pettersson](https://community.silverfin.com/u/Emmy_Pettersson)\
**Post date:** [June 12, 2020, 8:46am UTC](https://community.silverfin.com/t/rollforward-to-the-following-five-years-if-a-certain-variabel-is-greater-than-0/1817/1 "2020-06-12T08:46:21Z")

</div>

Hi Community,

I am trying to rollforward a value for the five following years if the variable’s value is greater than 0.

I have no issues with printing the variabel tax\_adjustment\_cy, but I must do something wrong when applying the rollforward function.

```auto
|{% if cbc_incl_acc_dep > lowest_tax_residual_value %}
          {% assign tax_adjustment_cy = -1*lowest_tax_residual_value-cbc_incl_acc_dep*-1 %} 
            {{ tax_adjustment_cy | integer }} 
              {% comment %}tax_adjustment_cy från föregående år ska användas i Total tax adjustment nedan{% endcomment %}
                {% comment %}RESULT-TAG to be included in tax calc provided having a value, i.e. greater than 0{% endcomment %} {% result 'skattemassig_justering_rakenskapsenlig_avskrivning' tax_adjustment_cy %} 
                 {% comment %}Rollforward if tax adjustment {% endcomment %}
                   {% rollforward custom.tax_adjustment_cy custom.tax_adjustment.year_1 %}
                     {% rollforward custom.tax_adjustment.year_1 custom.tax_adjustment.year_2 %}
                       {% rollforward custom.tax_adjustment.year_2 custom.tax_adjustment.year_3 %}
                         {% rollforward custom.tax_adjustment.year_3 custom.tax_adjustment.year_4 %}
                            {% rollforward custom.tax_adjustment.year_4 custom.tax_adjustment.year_5 %}
          {% else %}
            {{ 0 | integer }}
        {% endif %}´´´

I am then trying to print it in the following table 

{% comment %}ADDITIONAL DEDUCTIONS FOR LAST YEARS ADJUSTMENTS{% endcomment %}
  **{::font size="m"} {% t "foregaende_ars_for_hoga_avskrivningar" %}{:/font}**  

{% stripnewlines %} 
|----15%---
|----9%----
|----8%----
|----9%----:
|--------+
{% newline %}
|^{{ current_year_minus_2 }}^
|^ {{ custom.tax_adjustment.year_1 | integer }} ^
|^ {{ 0.2 | percentage precision:0 }} ^
|]^ {{ 0.2*custom.tax_adjustment.year_1 | integer }} ^
| &nbsp;

{% newline %}
  
|{{ current_year_minus_3 }}
|{{ custom.tax_adjustment.year_2 | integer }}
|{{ 0.2 | percentage precision:0 }}
|] {{ 0.2*custom.tax_adjustment.year_2 | integer }} 
| &nbsp;
  {% newline %}
    
|{{ current_year_minus_4 }} 
|{{ custom.tax_adjustment.year_3 | integer }}
|{{ 0.2 | percentage precision:0 }}
|] {{ 0.2*custom.tax_adjustment.year_3 | integer }}  
| &nbsp;
  {% newline %}
    
|{{ current_year_minus_5 }}
|{{ custom.tax_adjustment.year_4 | integer }}
|{{ 0.2 | percentage precision:0 }} 
|] {{ 0.2*custom.tax_adjustment.year_4 | integer}}
| &nbsp;

{% newline %}
|{{ current_year_minus_6 }} 
|{{ custom.tax_adjustment.year_5 | integer }}
|{{ 0.2 | percentage precision:0 }}
|] {{ 0.2*custom.tax_adjustment.year_5 | integer }}  
| &nbsp;

{% endstripnewlines %}

```

Thank you in advance for your feedback and thoughts 🙂

Kind regards,  
Emmy

---

<div class="post-metadata">

**Author:** ![Michiel](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/michiel/32/2364_2.png) [@Michiel](https://community.silverfin.com/u/Michiel)\
**Post date:** [June 15, 2020, 12:11pm UTC](https://community.silverfin.com/t/rollforward-to-the-following-five-years-if-a-certain-variabel-is-greater-than-0/1817/2 "2020-06-15T12:11:57Z")

</div>

Hi Emmy,

tax\_adjustment\_cy is local variable, so it doesn’t need `custom` in your rollforward statement.  
`{% rollforward tax_adjustment_cy custom.tax_adjustment.year_1 %}`

Best regards,

Michiel
