Working with YAML

First, ensure you're using Cube version 0.31.0 or higher. Then create a new .yml file in the schema/ folder.

The syntax for YAML modeling is very similar to the existing JavaScript syntax, with a few key differences:

  1. All schema properties can be written in either camel-case or snake-case i.e. countDistinctApprox can be written as count_distinct_approx, preAggregations can be written as pre_aggregations etc. We recommend using snake-case in YAML models.

  2. References to cubes, views and context variables should be wrapped in {} i.e. {FILTER_PARAMS.Orders.created_at.filter('created_at')}.

  3. String values only need to have quotes around them if they contain special values: "{CUBE}.user_id = {}"

Did you find this page useful?