1

I have a quick question on how we can use the BigQuery HLL functions in Looker.

For example, there is a BigQuery table with the following structure Sample BigQuery Table

  1. In looker do I need to define this field respondents_hll as a dimension or measure?
  2. If I use it as a measure, how can I extract the value of this HLL field at a different grouping level(for example, country only) and use it in dashboards without losing its meaning?
  3. If I bring this in as a Dimension, I still want to be able to show the extract of this HLL field at different level? How will looker understand the grouping?

Best Regards, Sam

iPrithvi
  • 11
  • 1
  • Ok, on further trial and error, I got this working. – iPrithvi Nov 12 '21 at 04:30
  • 2
    Explained below. Basically, we need to define the HLL field as a measure in the view definition. Then use the BigQuery's HLL_COUNT.MERGE functionality in the definition for the column. Something like this in the View definition: `measure: unique_respondents { group_label: "Unique" type: number sql: HLL_COUNT.MERGE(${TABLE}.respondents_hll);; }` Looker will automatically (magically ;) ) understand the grouping when you add a dimension and this measure in your explore. Gives you the correct result as the output for that grouping. – iPrithvi Nov 12 '21 at 04:38

0 Answers0