Hello Everyone,
I am new to BOB and first query posting here…
I were having report variable having formula like this:-
D=-a+(x+y+z) Surely result always yields to 0
Because a=x+y+z.
Then the output I was getting is -0 for some rows in column not all; some were populating 0. well when I were refreshing report some other values became -0 which were 0 and vice versa.
I tried all report level formating possibilities but didnt work.
However I solved the issue by creating the Object at Universe level.
But still wonder What was the issue???
Have anybody gone through? Please clear me…
Thanks,
Pradip T.
Rana (BOB member since 2008-07-08)
hi pradip,
you can try this way.
since your formulae is d=-a+(x+y+z)
you can create a separate variable naming G=(x+y+z)
then add d=G-a
you will find result…
thank you
judia
judia (BOB member since 2008-06-24)
Thanks Judia,
I tried your way it shows expected i. e. 0 temporarily again whenever I refreshes the report populates with -0.
I have tried all like changing the sequence of operands but happens same for temporarily.
while the object created with the same defination at universe gives correct result.
Please help me if have any other reason.
Thanks,
Pradip T.
Rana (BOB member since 2008-07-08)
I think you can also create an alert which checks whether the result is -0 and you can set it to display as 0. But I do not know why it shows so.
Jansi (BOB member since 2008-05-12)
hi pradip
check the same query results in toad.
You can also recheck the format of the cell.-> number.
thank you
judia
judia (BOB member since 2008-06-24)
system
July 8, 2008, 10:52am
6
Thanks Jansi,
Interestingly, Alerter also not working I tried by comparing with variable and cell content as well.
And as per Judia’s comment I did and re-tried format’s like number, custom…But I guess this is out of.
Is -0 is not comparable like Null?
Thanks,
Pradip T.
Rana (BOB member since 2008-07-08)
system
July 8, 2008, 11:09am
7
Then I think you can go for a variable say for e.g
new = Abs(D)
where D is -a+(x+y+z)
Or try (x+y+z)-a
Jansi (BOB member since 2008-05-12)
system
July 8, 2008, 11:18am
8
Jansi,
Well, that worked.
Thank you,
Pradip T.
Rana (BOB member since 2008-07-08)
system
July 8, 2008, 11:33am
9
Welcome Pratip. But which one worked?
Abs() function or (x+y+z)-A ?
Jansi (BOB member since 2008-05-12)
system
July 8, 2008, 11:36am
10
Abs() worked.
Thanks,
Pradip T
Rana (BOB member since 2008-07-08)
system
August 20, 2009, 1:38pm
11
Don’t you think the real negative values will loose their sign (-) by doing this?
I have a similar requirement …
i.e I want to display 0 when sum(1-1) becomes -0
Any thoughts?
vijaykollu (BOB member since 2003-05-08)
system
August 20, 2009, 1:45pm
12
Thats true real negative value will loose the sign.
In my case it was always coming 0 and still couldnt figured out why it was giving -0.
Thanks,
Rana (BOB member since 2008-07-08)
system
August 20, 2009, 2:13pm
13
Due to the way computers store numbers after calculations 0 is not always stored exactly as 0, may be something like -0.000000000000001
it is better to use the BO or db round function to achieve the correct value
Ottoman (BOB member since 2002-10-04)
system
August 20, 2009, 4:26pm
14
Rounding to 4 decimals solved my problem…
vijaykollu (BOB member since 2003-05-08)