Models
Attributes, measures, and relations are the fundamental building blocks of Hashquery models. They define what is interesting about your data, and allow you to share complex expressions across your analysis with ease.
Attributes
To add attributes, use
Model.with_attributes()
.To use attributes, use
attr.attribute_name
orattr["attribute_name"]
anywhere a column expression is needed.
Measures
To add measures, use
Model.with_measures()
.To use measures, use
msr.measure_name
ormsr["measure_name"]
anywhere an aggregating column expression is needed.
Relations
The most common way to add a relation is with a single join, using
Model.with_join_one()
.To use the attributes on a joined relation, use
rel.relation_name.attribute_name
orrel["relation_name"].attribute_name
anywhere a column expression is needed.To reference the relation itself (which is fairly rarely needed), use just
rel.relation_name
.