how will I convert this sql into explore script to create dimension in looker?
[Note : here table_recommendation , Markup and Markup are column names in Bigquery]
SELECT
CASE WHEN table_recommendation = ‘MD’ THEN Markup
WHEN table_recommendation = ‘MU’ THEN Markdown
ELSE 0 END AS segment,
I was trying below script to create dimension but i am getting error:
dimension: Item_Count {
type: number
case: {
when: {
sql: ${TABLE}.table_recommendation = ‘MD’ then ${ap_markdown_9} ;;
}
when: {
sql: ${TABLE}.table_recommendation = ‘MU’ then ${ap_markup_9} ;;
}
else: 0
}
}