Probably rounding problem in Cube

edited 10:01AM in FastCube
The problem is following:

We have one normal data column in slice (we call this MEASURE_1). One row is calculated to zero value shown in grid.
When i do "Drill trough" i see for example three rows (values 320, -40, -280).

The trick is when i use calculated measure like this one:

Result := Measures.Value / Measures.Value;

Of course Measures.Value can be ZERO so i must check this:

Result := 0;
if Measures.Value <> 0 then
Result := Measures.Value / Measures.Value; / Measures.Value;

This works fine in most cases but sometimes i get "Divide by zero" like error (actually for the values 320, -40, -280). Moreover when use something like

Result := 0;
if Measures.Value < 0.00001 then
Result := Measures.Value / Measures.Value; / Measures.Value;

it works well.

It looks like it is rounding problem (zero is show as zero but comparison to zero in code results in false > ).

Comments

  • edited 10:01AM
    Hi.

    Please send me cube file with this error. I will test it.

    Note for
    "if Measures.Value < 0.00001 then"
    0 < 0.00001 is True

    Oleg.

Leave a Comment