Hello everyone!
I am having trouble comparing two percentage measures; these measures are calculated in LookML and then I create the Look in the explorer.
LookML:
Measure '% Test A':
measure: perc_test_A {
label: "% Test A"
description: "% of Test group A"
value_format_name: percent_2
value_format: "0.00%"
sql: ${measure_a} / NULLIF(${measure_a_total}, 0);;
}
Measure '% Test B':
measure: perc_test_B {
label: "% Test B"
description: "% of Test group B"
value_format_name: percent_2
value_format: "0.00%"
sql: ${measure_b} / NULLIF(${measure_b_total}, 0);;
}
The problem arises when I want to create a bar or line chart, as the bars all appear to be the same size, even with different values between them.
Can you help me please?
Solved! Go to Solution.
Hi @JonasRocha — thanks for the clear details!
Double-check if both percentage measures are being treated as percentages or raw numbers in the chart settings.
In the visualization, set the axis scale manually (not auto) to ensure differences appear properly.
Also, confirm no aggregation (like average or sum) is flattening the values when passed to the chart.
Hi @JonasRocha — thanks for the clear details!
Double-check if both percentage measures are being treated as percentages or raw numbers in the chart settings.
In the visualization, set the axis scale manually (not auto) to ensure differences appear properly.
Also, confirm no aggregation (like average or sum) is flattening the values when passed to the chart.
Thank you very much for the attention you gave to my post; it was important for the resolution.
The problem was exactly as you mentioned: the graph was not being recognized as a number, so Looker was getting confused when plotting on the screen.
Resolution: The following code was added, and it worked: 'type: number'
measure: perc_test_B {
label: "% Test B"
description: "% of Test group B"
type: number
value_format: "0.00%"
sql: ${measure_b} / NULLIF(${measure_b_total}, 0);;
}
Thanks!