Difficulty Formatting Percentage Values in Looker Visualizations

Hello,

I'm encountering an issue with percentage formatting in Looker visualizations. I have defined a measure in LookML that calculates a ratio and I want to display it as a percentage. Here is the code:

measure: column {
  sql: 100.0 * ${x} / NULLIF(${y},0) ;;
  value_format: "0.00%"
  value_format_name: percent_0 
}

For this measure, I expect Looker to convert decimal outputs from the SQL calculation into percentage values in the visualization. Specifically, for example I want results like 0.2747 to convert to 27.47%.

However, I'm seeing unusual behavior with the rendering - it's not showing the expected percentages. I tried switching the value_format to ".00%", and removing the 100.0 multiplier in the SQL expression. But neither option provided the desired results.

Has anyone encountered this kind of behavior before or have any advice on this situation? Any help on this would be greatly appreciated.

Thank you,

0 1 714
1 REPLY 1

measure: conversion_rate {
type: number
value_format_name: percent_2
sql: ${transactions}/NULLIF(${ssessions}, 0) ;;
} this works for me.

Top Labels in this Space
Top Solution Authors