📜 ⬆️ ⬇️

XBRL: just about the complex - Chapter 6. Immersion in XBRL - Part 4. How to make life easier

6.4. How to make life easier


So far, we have used only simple item concepts. Each of the nr_employees concepts could be interpreted independently of the others.


This approach has a drawback: if the number of sexes is usually limited to two, then for the age we could have more groups than three in our example. What if we needed to divide the age into 10-year intervals? We would have to add new concepts for groups 11–20, 21–30, 31–40, 41–50, 51–60 and 61–70. And when divided into 5-year, 2-year or even annual intervals, this will quickly become tiring. The linkbases would become very large, since it would be necessary to define links for each of this set of concepts. I would like to have a more effective approach for such situations.


And today we will tell how tuples can help us with this.


Note: This is not a very good example. Categorization of concepts, such as gender or age groups, should be defined in the so-called taxonomies of measurement (dimensional taxonomy), which we will discuss in the following chapters.

6.4.1. Structural changes


The above problem occurs because we have included a category (gender, age group) in the concept Number of employees . What if we divide them into two different concepts?


This will lead to the following definitions of concepts:


<element id="sample_nr_employees_total" name="nr_employees_total" xbrli:periodType="instant" type="xbrli:nonNegativeIntegerItemType" substitutionGroup="xbrli:item" nillable="true" /> <element id="sample_nr_employees" name="nr_employees" xbrli:periodType="instant" type="xbrli:nonNegativeIntegerItemType" substitutionGroup="xbrli:item" nillable="true" /> <element id="sample_gender" name="gender" xbrli:periodType="instant" type="xbrli:stringItemType" substitutionGroup="xbrli:item" nillable="true" /> <element id="sample_age_group" name="age_group" xbrli:periodType="instant" type="xbrli:stringItemType" substitutionGroup="xbrli:item" nillable="true" /> 

Now most of our concepts cannot be interpreted independently - for example, what does gender or nr_employees mean?


Here tuples come into play: the combination of gender with nr_employees and the combination of age_group with nr_employees already have a certain meaning.


 <element id="sample_gender_data" name="gender_data" substitutionGroup="xbrli:tuple" nillable="true"> <complexType> <sequence> <element ref="sample:gender"/> <element ref="sample:nr_employees"/> </sequence> </complexType> </element> <element id="sample_age_group_data" name="age_group_data" substitutionGroup="xbrli:tuple" nillable="true"> <complexType> <sequence> <element ref="sample:age_group"/> <element ref="sample:nr_employees"/> </sequence> </complexType> </element> 

A tuple is an element with the value tuple the substitutionGroup attribute. It contains a complex type ( complexType ) in which the sequence concepts is defined.


To use new concept tuples, we need to update the links to the link bases of labels and presentations.


Links to the presentation base should look something like this:


 <presentationLink xlink:type="extended" xlink:role="http://www.sample.com/genderDemographics" > <loc xlink:type="locator" xlink:href="sample-2006-01-04.xsd#sample_nr_employees_total" xlink:label="concept_nr_employees_total" /> <loc xlink:type="locator" xlink:href="sample-2006-01-04.xsd#sample_gender_data" xlink:label="concept_gender_data" /> <loc xlink:type="locator" xlink:href="sample-2006-01-04.xsd#sample_gender" xlink:label="concept_gender" /> <loc xlink:type="locator" xlink:href="sample-2006-01-04.xsd#sample_nr_employees" xlink:label="concept_nr_employees" /> <presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="concept_nr_employees_total" xlink:to="concept_gender_data" order="1" priority="0" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel" /> <presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="concept_gender_data" xlink:to="concept_gender" order="1" priority="0" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel" /> <presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="concept_gender_data" xlink:to="concept_nr_employees" order="2" priority="0" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel" /> </presentationLink> <presentationLink xlink:type="extended" xlink:role="http://www.sample.com/ageDemographics" > <loc xlink:type="locator" xlink:href="sample-2006-01-04.xsd#sample_nr_employees_total" xlink:label="concept_nr_employees_total" /> <loc xlink:type="locator" xlink:href="sample-2006-01-04.xsd#sample_age_group_data" xlink:label="concept_age_group_data" /> <loc xlink:type="locator" xlink:href="sample-2006-01-04.xsd#sample_age_group" xlink:label="concept_age_group" /> <loc xlink:type="locator" xlink:href="sample-2006-01-04.xsd#sample_nr_employees" xlink:label="concept_nr_employees" /> <presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="concept_nr_employees_total" xlink:to="concept_age_group_data" order="1" priority="0" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel" /> <presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="concept_age_group_data" xlink:to="concept_age_group" order="1" priority="0" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel" /> <presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="concept_age_group_data" xlink:to="concept_nr_employees" order="2" priority="0" use="optional" preferredLabel="http://www.xbrl.org/2003/role/terseLabel" /> </presentationLink> 

Tuples are placed under the final concept (concept_nr_employees_total) and contains the concepts included in it as child elements.


6.4.2. And what does it look like?


Our report visualization application does not make assumptions about which of the concepts inside a tuple can be considered key , so it simply creates a small table of values, the columns of which are ordered according to the link base of presentations.


image


Please note that although our application does a good job of displaying simple tuples, in general this can be quite a challenge. Elements in tuples do not necessarily have to refer to the same context. And tuples can have infinite nesting, although in practice you are unlikely to find this.


This makes it difficult to visualize tuples and usually leads to human involvement, when an understanding of what needs to be visualized can be used to determine how best to do it.






')

Source: https://habr.com/ru/post/336230/


All Articles