Period minus - variables

Dear,

I want to code the following:

|:--12%--------:|-15%----------:|-15%-----------:|--15%-------------:|-10%---------:|-10%---------:|:-10%--------------:|-13%-----:+{% for year in (custom.start_year.NID_overview..period.fiscal_year) %}
{% stripnewlines %}
|{{ year.end_date }} 
|{% if year != period.fiscal_year %}{% if period.minus_(period.fiscal_year-year)y.exists %}}{% input custom.nid_in_principle[year] as:currency placeholder_default:period.minus_(period.fiscal_year-year)y.reconciliations.275_C_NID.results.NID_in_principle %}{% endif %}{% endif %} {% endfor %}

Anyone a clear idea on how this variable could be created and entered in to the code?

Could it be something like: ?

{% assign var = period.fiscal_year-year %}
{% assign varperiod = "minus_[var]y %}

Kind regards,

Glenn

Hi @GMOONS

You could try by using a capture for varperiod, making it possible to re-use in in the code by typing {{varperiod}}

Could you please try the following:

{% assign var = period.fiscal_year-year %}
{% assign varperiod = "minus_[var]y" %}

|:---12%--------:|---15%----------:|---15%-----------:|---15%-------------:|---10%---------:|---10%---------:|:--10%--------------:|-13%-----:+{% for year in (custom.start_year.NID_overview..period.fiscal_year)%}
{% stripnewlines %}
{% capture varperiod %}minus_{{period.fiscal_year-year | integer }}y{% endcapture %}
|{{ varperiod }} 
|{% if year != period.fiscal_year %}{% if period.minus_(period.fiscal_year-year)y.exists %}
  {% input custom.nid_in_principle[year] as:currency placeholder_default:period[varperiod].reconciliations.275_C_NID.results.NID_in_principle %}

{% endif %}{% endif %}{% endstripnewlines %}{% endfor %}

Kind regards,

Mathias

Hi @Mathias

Thanks for providing a possible answer! The capture-method solved my issue.

Thanks a lot,

Kind regards,

Glenn