Dear,
We seem to have an issue in a bunch of custom templates we have built several years ago, in which we show a selection of accounts, together with the value in current period, the value of the same current period but a year ago, and the movement of both values (expressed in %).
This has always worked, and no changes were added to these templates…
Here’s a simplified snippet of our template, that can help you understand the issue:
*{% comment %}show acc selector with default range{% endcomment %}*
*{% assign def_range = "61" %}*
*{% input custom.flux.accounts as:account_collection range:def_range default:def_range accounts_var:accounts %}*
*{% comment %}table overview: acc link, current year value, previous year value, %{% endcomment %}*
*{% stripnewlines %}*
*| Account (original number)*
*| Current year*
*| Previous year*
*| %*
*{% newline %}*
*|--------------*
*|----15%----:*
*|----15%----:*
*|----15%----:+*
*{% for acc in accounts.include_zeros %}*
*{% newline %}*
*| {{* [*acc.link*](https://protect-de.mimecast.com/s/7MZ-CK8gmghDzkGgFAJAwE?domain=acc.link) *}}*
*| {{ acc.value | currency }}*
*{% comment %}create value previous year{% endcomment %}*
*{% assign acc_nbr = acc.mapped_number %}*
*{% assign acc_py_value = period.minus_1y.accounts | range:acc_nbr %}*
*| {{ acc_py_value | currency }}*
*| {{ (acc.value-acc_py_value)/acc_py_value | percentage }}*
*{% endfor %}*
*{% endstripnewlines %}*
However, the value of previous year do not match anymore with the actual values from last year (which corrupts the calculation of the % too) for some accounts.
After some investigation, we’ve noticed the issue is happening in company files for accounts in which previous year has a different mapped number than the current year. We are surprised by this, as we didn’t expect a change in mapping cause this? We did change to the Silverfin standard mapping this year (previous year was a different mapping), but were not expecting this to have an impact on any template (Silverfin or custom made)…
It is a fact that in our coding, we use the mapped account number of current period to calculate the value of last year, which becomes faulty as soon as that account has a different mapped number in previous year. Previously, we assume that this number was always the same… However, how can we solve this, if we cannot use the mapped number? The report templates feature the same function, and there it isn’t broken (so perhaps there could the solution be found?).
Keep in mind too, that in all our templates we always show the original account number for any account (so visually, we never see a difference in account numbers). Not sure if this is related, but want to be sure to give all context.
Could you come back to us, and let us know if our assumption is correct (and more importantly, how we can fix this)?
Thank you.