It is now possible to access data from a analytical or consolidation file (on database level, they actually are the same).
To start, may we remind you that you can access the type of company, as explained here:
Let’s examine how we can access data in a consolidation file, so where data is gathered from several other company files into one company file and can be split up using those entities (keep in mind it works exactly the same for analytical files as well!):
{{ company.analytical_type_1_codes }}
This returns an array containing all companies that were added to the conso file, with information on the:
- code: unique code that each company has
- reference: the name for each company
(so for analytical files you can go to dimension 2 and 3 as well, using company.analytical_type_2_codes and company.analytical_type_3_codes )
What you could do with this array, is use it in a select input, like this:
{% comment %}create values for select dropdown{% endcomment %}
{% assign conso_1_names = company.analytical_type_1_codes | map:"reference" | join:"|" %}
{% assign conso_1_values = company.analytical_type_1_codes | map:"code" | join:"|" %}
{% input custom.chosen_file.conso as:select options:conso_1_names option_values:conso_1_values %}
The database variable custom.chosen_file.conso will have that unique code of the file you’ve chosen with the dropdown, and then you could use that value to have the output of certain accounts specifically linked to that code:
{% input custom.chosen_file.conso as:select options:conso_1_names option_values:conso_1_values assign:chosen_code %}
{% comment %}create accounts collection with chosen code and specific range/type{% endcomment %}
{% assign conso_accounts = period.accounts | analytical_code:chosen_code | range:"1001" %}
{% for acc in conso_accounts %}
{{ acc.link }} {{ acc.value | currency_dc }}
{% endfor %}
Above will then show all accounts from the range “1001” but for that specific analytical code.
So you could built anything you need from now on, for consolidation files in which numbers are presented for a specific company file for example.