Partition pruning from looker filters based on labels

Hi,

we have bigquery table as source for our view/explore.

This table has (to simplify) columns:
REGION_NAME, REGION_CODE, COUNTRY_NAME, COUNTRY_CODE, UNITS_SOLD (measure INT)

where COUNTRY_CODE is partitioned column


based on function  ABS(MOD(FARM_FINGERPRINT((COUNTRY_NAME)),4000))

In looker dashboard we have filter for COUNTRY_NAME being multi-selection.

User would select several countries to filter dashboards tiles/visuals.

Ideally we want to profit from the partitions in bigquery for performance and costs reasons.

We are currently unable to force looker via lookml to push in the SQL requests in WHERE clause the COUNTRY_CODE which corresponds to the COUNTRY_NAME selected in the filter (with option to select multiple COUNTRY_NAMES in the filter).

We were experimenting with sql_always_where option using specific pCOUNTRY parameter filtered from the dashboard in this format :

sql_always_where:
${COUNTRY_CODE} in ABS(MOD(FARM_FINGERPRINT(({{  table.pCOUNTRY._parameter_value  }})),4000))

that seems work but its limited to mono selection because looker parameters supports only one value so does not work with multiple countries selected to be passed from dashboard filter to the parameter

Thank you for any help

Regards

0 0 185
0 REPLIES 0
Top Labels in this Space
Top Solution Authors