Probably rounding problem in Cube

edited 5:13PM 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 5:13PM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.