This functionality allows you to compose a field using the data from one or more of its child documents in one of its detail tabs.
For example, a document from the Country category has several documents from the Province category associated with it. And if we want to create a field in Country that lists the data of all its Provinces, we will use the formula:
Where:
Field_list : is the name of the dropdown list in the child category, where the document of the parent category is selected. Its syntax is that of a tag type:< @CodeCategory:Group:Field> . For example, in Country, we can combine the data of your Provinces as follows:
Fields : is the text string between quotes with the field labels that we want to extract from each child document. These labels are of the same type as the Field_list. In this case they can be combined with fixed text as we see in the example:
Separator : is a text string between quotes that will separate the data of each document. You can include \n for line breaks or \t for tabs. For example:
Order : is an ordering text string. Indicates on which field or fields we want to order the results. The syntax must include the name of one or more fields separated by commas. Behind each of them we can specify the ASC or DESC clause to indicate the order. For example:
Condition : This is an optional parameter with a T-SQL condition text string of the same type used in dropdown lists. It allows us to filter the results of the aggregate. For example, to filter Provinces starting only with Al :
Top: is an optional parameter with a number indicating the maximum number of records to return.
Grouping: is an optional parameter that indicates the field by which you want to group. When using groupings it is possible to indicate the aggregate functions:
- COUNT(*) to return the number of elements
- SUM(field) to get the sum of numeric and currency fields
- AVG(field) to get the sum of numeric and currency fields
- MAX(field) to get the maximum value of the field
- MIN(field) to obtain the minimum value of the field
It is important to know that when using groupers, only fields that are already included in the Fields parameter can be used in the Order parameter.
The final formula (without grouping) from a field of the Country category called Provinces starting with Al and its area is as follows:
Therefore, for the Country Spain, the Provinces that begin with Al field and its area would show the following value:
Province: Albacete, Area km2: 14.926
Province: Alicante, Surface km2: 5.817
Province: Almería, Surface area km2: 8.775
A variant with groupings of provinces could be as:
Therefore, for the Country Spain, the Provinces that begin with Al field and its area would show the following value: