How to define a dimension with custom values on LookML?

Shax
New Member

I need to create a dimension with custom values such as ‘Demand’, ‘Visits Last Year’, ‘Avg Selling Price’  for visualization purposes. 

In SQL its easy to write a query in the following manner that would create a column in the table with custom values. “Select ‘Demand’, ‘Visits Last Year’, ‘Avg Selling Price’”

How to achieve the above on LOOKML ?

  1. Tried to write a SQL query while defining a dimension but does not seem to work. 

  dimension: custom_metric_name {
    type: string
    sql: “Select ‘Demand’, ‘Visits Last Year’, ‘Avg Selling Price’“ ;;
  }

I don’t want to create a view and join it with an explorer. We have a centralized data model and do not want to create custom views. 

0 1 490
1 REPLY 1

It depends on what you need to do with it to be honest. Are you going to CROSS JOIN it to somewhere? Can you not create this dictionary-type of a table in your Data Model?

Top Labels in this Space
Top Solution Authors