Guys, would there be any way to instead of showing...
# gd-beginners
t
Guys, would there be any way to instead of showing 'no data', it would appear blank or 0?
m
Hello Tomas, generally speaking, it is possible to change the output of a metric value via the CASE statement and metric formatting, for example: SELECT CASE WHEN condition1 THEN outcome1, WHEN condition2 THEN outcome 2 ELSE outcome3 END Numerical formatting: [=1] String However, I am having difficulties identifying where element in the screenshot is located, it seems to be an attribute. If so, I am afraid it will not possible to change the legend, you will need to handle this at the data source level.
t
That would be the metric, how could you do what it says?
m
You would need to enclose the entire metric in the ifnull statement so it returns a predifined value in case there is a null result, for instance, 0; if you want to modify the value for a blank character, you may include it in the conditional formatting: blank character.
m
Actually, if you only need to format an existing NULL value in your data, you don’t need to use the IFNULL function and can just use the [=Null] prefix in the formatting string (documentation). Note that if you change form the default format and have negative values, you might also need to define the format for them to have the minus sign. A formatting string like this will make your “No data” into “N/A” and keep positive numbers normal and negative numbers with a minus sign:
Copy code
[=Null]N/A;
[>=0]#,#;
[<0]-#,#;