Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Metadata


You can change the format and display of your chart by using the metadata key of the Matatika dataset YAML file.

The metadata key relates to how the data from the query within the dataset is displayed as an insight.

Example

metadata: |-
    {
        "name": "google_analytics_locations",
        "label": "Daily Users",
        "related_table": {
        "columns": [
            {"name": "report_date", "label": "Date", "description": "Date"}
        ], 
        "aggregates": [
            {"name": "total_users", "label": "Total Users", "description": "Total Users"}
        ]
        }
    }

Metadata Key Details
name Name of the sql table you are querying, or it alias if assigned.
label Chart label.
related_table Columns and aggregates to display in the chart.
columns x-axis catagories, usually dates or groups.
aggregates Bars, Points, Lines that show the information over the columns catagories.
links Can be defined to connect datasets or external links, either by clicking on specific aggregates, or defining a link globally.

With a global link, if you click on any of the data in the visualisation you have to option of viewing what is linked. You can use a global link to drill-down to another dataset, or link to an external source.

metadata: |-
    {
        "name": "google_analytics_locations",
        "label": "Daily Users",
        "related_table": {
        "columns": [
            {"name": "report_date", "label": "Date", "description": "Date"}
        ], 
        "aggregates": [
            {"name": "total_users", "label": "Total Users", "description": "Total Users"}
        ]
        },
        "links": [{"dataset": "another_datasets_file_name_without_file_extension"}]
    }

With an aggregate link, if you click on the specific aggregate data in the visualisation you have to option of viewing what is linked. You can use a aggregate link to drill-down to another dataset, or link to an external source.

metadata: |-
    {
        "name": "google_analytics_locations",
        "label": "Daily Users",
        "related_table": {
        "columns": [
            {"name": "report_date", "label": "Date", "description": "Date"}
        ], 
        "aggregates": [
            {"name": "total_users", "label": "Total Users", "description": "Total Users", "links": [
                    {"href": "https://developers.google.com/analytics", "target": "_blank"}]
            }
        ]
        }
    }

Further Reading: