Skip to main content

Hi, I’m working with data stories, and I’ve created a custom metric to represent by using percentage format.

This is the metric expression:

iff(sum("Valid") + sum("Invalid") > 0, round(sum("Valid") * 100/ (sum("Valid") + sum("Invalid")), 2) / 100, 0)

Both “Valid” and “Invalid” are defined in Snowflake as REAL datatype.

I’ve read this article Create Custom Attributes :: Ataccama ONE and I’m using round function, but it doesn’t work.

Thanks in advance,

Gaston

 

Solution: if you want to control the decimal places...do not use “round” 😕

​​​​​​​iff(sum("Valid") + sum("Invalid") > 0, sum("Valid") * 100/ (sum("Valid") + sum("Invalid")) / 100, 0)

I think this is a bug, because if I need to display 3 or more decimal places...I have to use round.


Reply