Parent-Child Filters

👤 This documentation is intended for SQL Users.

Parent-Child Filters allow a filter's options depend on the values selected in another filter. For example, a "Device" filter could only show the devices that match the selected platforms in a "Platform" filter.

Parent Filter

To start, a parent filter is needed. Let us call it "Platform." The parent filter can be created like a regular filter.

In the filter SQL box, we use:

SELECT distinct platform FROM gameplays

Child Filter

Once the parent filter has been made, a child filter can be created! Let us call it "Device."

In the child filter we use:

SELECT distinct device, device, platform FROM gameplays

The child filter needs three values to be select in the following order: child filter value, child display value, and parent matching value. In this case, the child filter values and the child display value are the same, thus device is selected twice.

With this child filter query, it it ready to be linked to the parent filter!

Expanding out "More Options," click the "Make this filter a child of" checkbox and select "Device" in the dropdown.

Now when a specific platform is selected, only devices on that platform will be populated in the Device filter.

Using Parent and Child Filters

To use parent and child filters in charts, one or both filters can be used in the chart query the same way regular filters are used: 

where [my_parent_column_name=ParentFilterName]
and [my_child_column_name=ChildFilterName]

With the above set up, the query will respond to each filtering criteria individually. Selections in the parent filter will filter down the query results based on the selected parent filter value(s), and selections in the child filter will filter down the query results based on the selected child filter value(s).

Our support team is ready to help