Developer Documentation Library > Scripting > Expressions > Hierarchical expressions > Working with parallel levels
 
Working with parallel levels
Some data sets contain levels that are not related to each other. For example, in the diagram in Hierarchical expressions the Person and Vehicle levels are parallel to each other (on different branches of the tree). This means that the data in the two levels is not directly related to each other. However, you might want to include data from parallel levels in an expression. For example, to select men who live in households that have a motorbike, use the data in the Vehicle level in your Person-level expression.
When you include data from a parallel level in an expression, you must up-lev the data to the first common ancestor level and then down-lev the data to the level of the expression. In the Household sample, the only level that is an ancestor of both the Person and Vehicle levels is the top (HDATA) level. The following expression up-levs the Vehicle-level data to the top level and down-levs it to the Person level:
^.Sum(Vehicle.(VehicleType = {Motorbike})) > 0 And Gender = {Male}
This expression selects men and boys who live in a household that has one or more motorbike.
See
Hierarchical expressions