Table with dynamic results

Dear,

I created a table with the code below.

I have two problems with it:

  • The sum that I make in the fifth column doesn’t display and I have no idea why?

  • If my period is > 2014 my table is linked to another form in which the values are completed and should be shown automatically in this table but it does not work either.

Can anyone help me with these issues?

Thanks

{% input custom.values.start_year %}

|{% t “Financial year” %} |{% t"Tax losses carried forward per previous year (-)" %} | {% t “Tax losses carried forward used current year” %} | {% t “Tax losses of the curent year (-)” %} | {% t “Tax losses carried forward per year end (-)” %} | {% t “Statute of limitation *” %}
|-10%-------|--------------------------------------|------------------------------------|-----------------------------------|-----------------------------------|-----------------------|-15%--------+{% for year in (custom.values.start_year…period.fiscal_year) %}
{% stripnewlines %}
|{{ year }}
| {% if year > 2014 %} {% assign custom.tlcf_start[year] = period.reconciliations.tax_attributes.custom.tax.losses_to_CF %} {{custom.tlcf_start[year]}} {% else %} {% input custom.tlcf_start[year] %} {% endif %}
| {% if year > 2014 %} {% assign custom.tlcf_used[year] = period.reconciliations.breakdownofprofit.custom.breakdownofprofit.tlcf1+period.reconciliations.breakdownofprofit.custom.breakdownofprofit.tlcf2 %} {{custom.tlcf_used[year]}}{% else %} {% input custom.tlcf_used[year] %} {% endif %}
| {% if year > 2014 %} {% assign custom.tlcf_year[year] = period.reconciliations.tax_attributes.custom.tax.losses_current_period %} {{ custom.tlcf_year[year] }} {% else %} {% input custom.tlcf_year[year] %} {% endif %}
| {% assign tlcf_end[year] = custom.tlcf_start[year]+custom.tlcf_used[year]+custom.tlcf_year[year] %} {{ tlcf_end[year] }}
| {% t “UNLIMITED” %} {% assign result_key = key | append:"_totaal_deze_tabel" %}
{% endstripnewlines %}{% endfor %}

Hello @marnixcoudre,

Perhaps it is easier do the calculations with registers: using $1 to store a value for example.

{% input custom.values.start_year %}

|{% t "Financial year" %} |{% t"Tax losses carried forward per previous year (-)" %} | {% t "Tax losses carried forward used current year" %} | {% t "Tax losses of the curent year (-)" %} | {% t "Tax losses carried forward per year end (-)" %} | {% t "Statute of limitation *" %}
|-10%-------|--------------------------------------|------------------------------------|-----------------------------------|-----------------------------------|-----------------------|-15%--------+{% for year in (custom.values.start_year..period.fiscal_year) %}
{% stripnewlines %}
|{{ year }} 
{% assign $1 = 0 %}
| {% if year > 2014 %} {% =$1+ period.reconciliations.tax_attributes.custom.tax.losses_to_CF %} {% else %} {% $1+input custom.tlcf_start[year] %} {% endif %} 
| {% if year > 2014 %} {% =$1+ period.reconciliations.breakdownofprofit.custom.breakdownofprofit.tlcf1+period.reconciliations.breakdownofprofit.custom.breakdownofprofit.tlcf2 %}{% else %} {% $1+input custom.tlcf_used[year] %} {% endif %}
| {% if year > 2014 %} {% =$1+ period.reconciliations.tax_attributes.custom.tax.losses_current_period %} {% else %} {% $1+input custom.tlcf_year[year] %} {% endif %}
|  {{ $1 }} 
| {% t "UNLIMITED" %} {% assign result_key = key | append:"totaaldeze_tabel" %} 
{% endstripnewlines %}{% endfor %}

Could you please try this and let us know if the issues are resolved?
If the link to the other form is still not correct, we will probably need the code from the other template as well.

Thanks in advance!