Difference between revisions of "Publication Table"

From Fusion Registry Wiki
Jump to navigation Jump to search
(Overview)
(Syntax)
Line 8: Line 8:
 
[[File:Publication Table.png|none|left]]
 
[[File:Publication Table.png|none|left]]
  
= Syntax =
+
= Table Cell Syntax =
 +
==Overview ==
 +
A Publication Table is made up of two types of cell, a Heading cell (row heading or column heading) and a Table Body cell (in the body of the table).  Both Heading cells and body cells can contain free text and variable text.  Body cells can refer to data points using the series key syntax, and body cells can also define calculations based on multiple input series.
 +
 
 +
== Text Variables ==
 +
Table titles, subtitles, heading cell and free text cells can make use of variables for their cell content.  These variable types are described in the table below.
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Variable Type !! Description !! Syntax !! Example Output
 +
|-
 +
| '''Dataflow Name''' || Displays the name of a Dataflow referenced by the Publication Table in the locale in which the Publication Table is built.  When the publication table imports a Dataflow, it gives the Dataflow an alias.  The Alias is referenced in the variable.  || $(EDU) || World Bank, Education
 +
|-
 +
| '''Dataflow Description''' || Displays the description of a Dataflow referenced by the Publication Table in the locale in which the Publication Table is built.  When the publication table imports a Dataflow, it gives the Dataflow an alias.  The Alias is referenced in the variable.  || $(EDU.desc) || World Bank, Education
 +
|-
 +
| '''Dataflow Id''' || Displays the ID of a Dataflow referenced by the Publication Table. || $(EDU.id) || DF_EDU
 +
|-
 +
| '''A Dimension Name or Value''' || This type of variable exists if one or more of the table body series keys contains a wildcard for the Dimension.  For example, if a series key omits a value for the Country Dimension for a given Dataflow, then this Dimension becomes a variable Dimension whose value can be provided at build time.  The table headings can then contain a variable placeholder for this dimension which is resolved when the table is built.|| $(REF_AREA)|| United Kingdom
 +
|-
 +
| '''Dimension Name or Value''' || This type of variable exists if one or more of the table body series keys contains a wildcard for the Dimension.  For example, if a series key omits a value for the Country Dimension for a given Dataflow, then this Dimension becomes a variable Dimension whose value can be provided at build time.  The table headings can then contain a variable placeholder for this dimension which is resolved when the table is built.|| Example || Example
 +
|-
 +
| Example || Example || Example || Example
 +
|-
 +
| Example || Example || Example || Example
 +
|-
 +
| Example || Example || Example || Example
 +
|}
 +
 
 +
== Time Variables ==
 +
When the Publication Table is displaying data for a Time Series Dataflow, the Time Period can be part of the Observation Key.  However, time can also be a variable which is resolved at table build time.  This variable can also be manipulated by moving forward or backwards ‘n’ number of periods from the ‘base time period’ for which the table is built.
 +
 
 +
# . 
 +
 
 +
# '''A Value for Time Period'''.  When the Publication Table is displaying data for a Time Series Dataflow, the Time Period can be part of the Observation Key.  However, time can also be a variable which is resolved at table build time.  This variable can also be manipulated by moving forward or backwards ‘n’ number of periods from the ‘base time period’ for which the table is built.
 +
 
 +
# '''A fixed pointer to a Component Value'''.  This variable references a Component in a DSD or a Component value in a DSD.  The variable is resolved to the name of the Component, i.e. ‘reporting Country’ or the a specific value for the Component, i.e. ‘United Kingdom’.
 +
 
 +
# '''A reference to an imported variable'''.  Codelists and Valuelists which exist in the Fusion Registry can be imported into a Publication Table and given an alias.  The table can then reference items in the Codleist/Valuelist which is imported.
 +
 
 
== Data Cell Syntax ==  
 
== Data Cell Syntax ==  
  

Revision as of 04:29, 28 March 2022

Overview

A Publication Table provides the means to explicitly define the structure and content of a table of data. Publication Tables can make use of variable text placeholders in the table heading, and row and column headings, it can contain variable dimensions in the cells, and include calculated data and time arithmetic. Publication Tables can also display data from multiple SDMX Dataflows in the same table and can even perform calculations across Dataflows.

The following image shows a very simple Publication Table structure, where the table headings contain static text, and each cell describes an observation to show via the series key. Other parts of this table definition describe the table title, subtitle, and what the source Dataflow is.

Publication Table Definition.png
Publication Table.png

Table Cell Syntax

Overview

A Publication Table is made up of two types of cell, a Heading cell (row heading or column heading) and a Table Body cell (in the body of the table). Both Heading cells and body cells can contain free text and variable text. Body cells can refer to data points using the series key syntax, and body cells can also define calculations based on multiple input series.

Text Variables

Table titles, subtitles, heading cell and free text cells can make use of variables for their cell content. These variable types are described in the table below.

Variable Type Description Syntax Example Output
Dataflow Name Displays the name of a Dataflow referenced by the Publication Table in the locale in which the Publication Table is built. When the publication table imports a Dataflow, it gives the Dataflow an alias. The Alias is referenced in the variable. $(EDU) World Bank, Education
Dataflow Description Displays the description of a Dataflow referenced by the Publication Table in the locale in which the Publication Table is built. When the publication table imports a Dataflow, it gives the Dataflow an alias. The Alias is referenced in the variable. $(EDU.desc) World Bank, Education
Dataflow Id Displays the ID of a Dataflow referenced by the Publication Table. $(EDU.id) DF_EDU
A Dimension Name or Value This type of variable exists if one or more of the table body series keys contains a wildcard for the Dimension. For example, if a series key omits a value for the Country Dimension for a given Dataflow, then this Dimension becomes a variable Dimension whose value can be provided at build time. The table headings can then contain a variable placeholder for this dimension which is resolved when the table is built. $(REF_AREA) United Kingdom
Dimension Name or Value This type of variable exists if one or more of the table body series keys contains a wildcard for the Dimension. For example, if a series key omits a value for the Country Dimension for a given Dataflow, then this Dimension becomes a variable Dimension whose value can be provided at build time. The table headings can then contain a variable placeholder for this dimension which is resolved when the table is built. Example Example
Example Example Example Example
Example Example Example Example
Example Example Example Example

Time Variables

When the Publication Table is displaying data for a Time Series Dataflow, the Time Period can be part of the Observation Key. However, time can also be a variable which is resolved at table build time. This variable can also be manipulated by moving forward or backwards ‘n’ number of periods from the ‘base time period’ for which the table is built.

  1. .
  1. A Value for Time Period. When the Publication Table is displaying data for a Time Series Dataflow, the Time Period can be part of the Observation Key. However, time can also be a variable which is resolved at table build time. This variable can also be manipulated by moving forward or backwards ‘n’ number of periods from the ‘base time period’ for which the table is built.
  1. A fixed pointer to a Component Value. This variable references a Component in a DSD or a Component value in a DSD. The variable is resolved to the name of the Component, i.e. ‘reporting Country’ or the a specific value for the Component, i.e. ‘United Kingdom’.
  1. A reference to an imported variable. Codelists and Valuelists which exist in the Fusion Registry can be imported into a Publication Table and given an alias. The table can then reference items in the Codleist/Valuelist which is imported.

Data Cell Syntax

Each data cell in a publication table is defined by a cell key, which resolves to an observation when the table is materialised.

  1. A fully formed cell key consists of Dimension Values for each Dimension including Time Period if the DSD has a Time Dimension.
  2. If there are multiple measures in the DSD the Measure Dimension should also be included.
  3. A cell key can leave out Dimension values, in doing so the Dimension value is treated as a variable, which can be passed in at 'run time' to build the table output
  4. A cell key can leave out Dimension values, in doing so the Dimension value is treated as a variable, which can be passed in at 'run time' to build the table output
  5. A cell key can treat time as a variable, and also provide arithmetic on the Time Dimension to move forwards and backwards in periods, or to change Frequency
  6. A cell key can include calculations

Examples:

|- ! Cell Key !! Description |- | A:UK:EMP:M || Series key without Time |- | A:UK:EMP:M:2008 || Series key with Time |- | A:UK:EMP:M:2008:BIRTHS || Series key with Time and ID of Measure Dimension |- | A:UK:EMP:M:P || Series key with variable Time |- | A::EMP:M:P || Series key with variable dimension and variable Time |- | A:UK:EMP:M:P-1 || Series key with variable Time, which is 1 period before the base period of the table |- | :=A:(UK+FR):EMP:M || A calculated value from 2 series |}


Time Arithmetic Syntax

Syntax Description Example Input Example Output
Example Example Example Example
Example Example Example Example
Example Example Example Example
Example Example Example Example
Example Example Example Example
Example Example Example Example
Example Example Example Example

Variable Syntax