No Translation available yet
You have Slovak selected as language but this page has not been translated yet. Translate the page or view the content in the default space language below.
Display default
This tutorial gives you an example how to handle formulas which contain calculations with 'null' result. Otherwise when you are counting with null values the result is always 0.
def a = (filter("L_PRODUCT in ('TV')") {M_SALES})
def b = (filter("L_PRODUCT in ('Radio')") {M_SALES})
def c = (filter("L_PRODUCT in ('PC')") {M_SALES})
if(a == null || a == Double.NaN) {
a = 0
}
if(b == null || b == Double.NaN) {
b = 0
}
if(c == null || c == Double.NaN ) {
c = 0
}
return a/(a + b + c)
You can observe result on the visualisations below.
Result:
Before: