Customizing datasets

Choose a system name and a user friendly label for your dataset. The system name must be unique among the datasets of this catalog. You have more freedom in your choice of label, but keep in mind that datasets with similar or the same label may be confusing for your catalog users.

name: matches_and_players

label: Matches and Players

You can also add a description for your dataset. Dataset descriptions will appear in the catalog homepage.

description: Match summary data with player attributes for both winners and losers of each match.

Add your base view for the dataset.

from: matches

To add a join to an additional view add the join list and a view group. View should contain the system name of the view to be joined. If you want, you can also add an alias for simple referencing in the constraint syntax, and a user friendly label. This is how the view will appear in this dataset in the canvas UI. Labels are particularly useful if you're using the same view for different use cases in distinct datasets, or if you're joining the same view multiple times in the same dataset.

join:
  - view: players
    alias: winners
    label: Winners

The constraint contains the join conditions between views. If you have defined aliases for one or more of your views you can use them here. Multiple join conditions can be added in the same way you would in an SQL statement using and and or

join:
  - view: players
    alias: winners
    label: Winners
    constraint: winners.player_id=matches.winner_id

relationship contains the cardinality of the relationship between the views being joined.

join:
  - view: players
    alias: winners
    label: Winners
    constraint: winners.player_id=matches.winner_id
    relationship: many_to_one

Join type can be any one of: left, right, inner, or full

join:
  - view: players
    alias: winners
    label: Winners
    constraint: winners.player_id=matches.winner_id
    relationship: many_to_one
    type: left

Defining multiple joins in a dataset is as simple as adding an additional view to the join list.

join:
  - view: players
    alias: winners
    label: Winners
    constraint: winners.player_id=matches.winner_id
    relationship: many_to_one
    
  - view: players
    alias: losers
    label: Losers
    constraint: losers.player_id=matches.loser_id
    relationship: many_to_one

When the same view has been joined multiple times in a single dataset, using label makes the dataset easier to navigate in the canvas. In the canvas UI joined views are displayed together when their dataset is selected.

You can find more information on available join types in the Schema on the right-hand side.

Last updated