Liquid _in_query not working for custom dimensions


I have a set of derived tables where I use Liquid to include/exclude columns in the SELECT statement based on whether or not the user selects it in the Explore. It goes something like this:

{% if table_name.bundle_id._in_query %} 
{% endif %}

That works fine when a user includes the field bundle_id in their result set or in the filters.

However, when a user wants to create a custom dimension based on bundle_id without including the field in their result set or in the filters, the column is not picked up by Liquid and this error message is generated:

SQL Syntax Error: SQL compilation error: error line 62 at position 2 invalid identifier 'TABLE_NAME.BUNDLE_ID'


The only fix I found for this is to include the field in a filter and filter on ‘is not null’. However, that’s impractical, as I would have to educate all users about this error.

Is there a way to make the Liquid ._in_query variable to include custom dimensions without having to include the field in a filter?


Thanks! :) 

This topic has been closed for comments