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:
All schema properties can be written in either camel-case or snake-case i.e.
countDistinctApprox
can be written ascount_distinct_approx
,preAggregations
can be written aspre_aggregations
etc. We recommend using snake-case in YAML models.References to cubes, views and context variables should be wrapped in
{}
i.e.{FILTER_PARAMS.Orders.created_at.filter('created_at')}
.String values only need to have quotes around them if they contain special values:
"{CUBE}.user_id = {Users.id}"
Did you find this page useful?