Dynamic Joins based on filters

Is it possible to use Liquid to dynamically define a join in an Explore based on certain filters?

For example

explore: name {
    ...
}
{% if filter = 'x' %}
join: join_x {
   ...
}
{% elseif filter = 'y' %}
join: join_y {
   ...
}

By selecting a certain filter in the Explore the different join would appear. This would also need to update the UI to show the available dimensions/measures from the view based on the join.

Is this something that is possible?

Solved Solved
0 8 2,131
1 ACCEPTED SOLUTION

Hi Luke, you’re correct, that was my bad, _filters['...'] is not available in parameters that begin with sql_ I found in the doc I posted above. So what you would want would be to set up a parameter to manually toggle the join back and forth.

It sounds like what you’re trying to do would be more easily accomplished by creating a few separate, more modular explores. The explore itself will not dynamically rearrange itself based on the contents of a look the way you describe, so you would have to have each join in the explore consider each of the configurations you’d want to have. This will get messy pretty quickly, so I would recommend multiple explores.

View solution in original post

8 REPLIES 8
Top Labels in this Space
Top Solution Authors