Is there a way to use conditional formatting to re...
# gd-beginners
c
Is there a way to use conditional formatting to references another metric? I have a table with dates for columns, rows as vehicles, and within each vehicle I have a few metrics (active: values are 0 or 1), passenger boardings, passenger alightings. I’m looking for a way to highlight cells where the vehicle is active (1) AND passenger boardings OR alightings are 0. I’m trying to emulate this by nesting some custom metrics and using the product of active vehicles * boardings * alightings to identify, but it’s a bit clunky. Referencing another metric would simplify it for me.
m
Hi Cliff, In GoodData Cloud, while there is no direct built-in feature for conditional formatting that references another metric. However, perhaps you can use Conditional statements to help with this. Conditional statements that use IF THEN ELSE or CASE WHEN THEN formulations return values or metric expressions depending on whether specific conditions are met. IFNULL allows you to substitute a predefined replacement value in a visualization, if a null value is returned. Please see the sub-sections of the following documentation to learn more about this: https://www.gooddata.com/docs/cloud/create-metrics/maql/conditionals/
c
Thanks. I’m working, just in the Create Metric UI in the Insights designer, so I don’t think I can use IF, Then ELSE or IFNULL, It is only letting me choose 2 other metrics and set the outcome to ratio, Products, Sum, or Difference. We don’t expose the ability to make fully custom metrics to our customers, so I’m trying to solve it with that same limitation. If it isn’t possible, I’ll stick with my solution of a pair of custom metrics, and conditional formatting.
m
Thanks for getting back to me and for clarifying your situation - In this case, you’re correct and you’ll need to stick with your current solution of a pair of custom metrics, and conditional formatting
1