Rounding Up & Modulo

Hello, How it is possible to round up number in EayzBI. In core MDX there seems to be function RoundUp, which is not supported by EayzBI.

I have tried to get modulo, but I have no idea how. I have tried MOD or \, but they does not sees to be supported as well.

I could use it to have X - (X MOD 1) + 1 to round anything up or just X - (X MOD 1) for rounding down.

Can you please advice?

Hi Petr,

You are right, there is no RoundUp(…) function in MDX for eazyBI. But MOD(…) function is available for you. The syntax is a bit different though - you specify the X and Y as the function parameters: MOD(X, Y). Try the following

X - MOD(X, 1) + 1

Note that there is also Fix(…) function available that would return the integer portion of the number (without rounding).

Lauma / support@eazybi.com

1 Like

It works perfectly. I was struggling with MOD for a while, but then I realized that my MDX is Integer data type :slight_smile:
Thank you for help!

1 Like

sorry
please, could you explain How MOD() works
thank you
DKostiuk

Hi @DKostiuk

MOD() is a modulo function that returns the remainder after a number is divided by a divisor.

For example, MOD(9, 2) will return 1, as 2 fits 4 times in 9, and 1 is the remainder.

1 Like