Skip to Content
0

Displaying Positive/Negative numbers from a formula

Mar 10, 2017 at 10:52 AM

66

avatar image

This question has been asked/answered in the link below.

However, I am trying to adding to it the following addittion:

IF ZERO THEN OK

How can I get this result?

https://archive.sap.com/discussions/message/6494472#6494472

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

9 Answers

Best Answer
Abhilash Kumar
Mar 10, 2017 at 11:00 AM
0

Hi Rony,

Please try this code:

local numbervar a := {field1} - {field2};
if a > 0 then
"+" & totext(a,'#') 
else if a < 0 then
"-" & totext(a,'#')
else
'OK'

-Abhilash

Share
10 |10000 characters needed characters left characters exceeded
Dirty Rony Mar 10, 2017 at 11:22 AM
0

Thank you.

However, Ok is not showhing where results are zero, just a blank field.

Share
10 |10000 characters needed characters left characters exceeded
Abhilash Kumar
Mar 10, 2017 at 12:17 PM
0

Are there Null values?

The formula works fine for me, though.

Open the formula and look for an option on the top that says 'Exceptions for Nulls'; change it to 'Default Values for Nulls'.

-Abhilash

Share
10 |10000 characters needed characters left characters exceeded
Dirty Rony Mar 10, 2017 at 12:54 PM
0

I changed to

'Default Values for Nulls'

and there was not alteration in the result.

Share
10 |10000 characters needed characters left characters exceeded
Abhilash Kumar
Mar 10, 2017 at 01:23 PM
0

Could you post the numbers in field 1 and field 2 please?

-Abhilash

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Abhilash

Did you get a chance to check the data source?

0
Dirty Rony Mar 10, 2017 at 01:50 PM
0

You can get the Excel spreadsheet in the link below.
The data of both tabs are pulled into the report.
Note that in the Bond Data tab some codes repeat more that once, whereas in the Quickbooks data the same codes only appear once with the summary qty.

https://www.dropbox.com/s/9981gfi651a7e4w/28FEB17%20Stock%20Valuation%20from%20Bond%20and%20U76_S.xlsb?dl=0

Share
10 |10000 characters needed characters left characters exceeded
Brian Dong Mar 10, 2017 at 06:38 PM
0

Hi,

I took the liberty of downloading the spreadsheet to have a look.

How are you linking the worksheets? The only link I could use it Stock Level.

What numbers are you trying to evaluate? I'm assuming Stock Level.

Brian

Share
10 |10000 characters needed characters left characters exceeded
Dirty Rony Mar 13, 2017 at 08:41 AM
0

Hi Brian

Yes, trying to evaluate stock level, but the report is grouped by bond short code, then subgrouped by qb short code.

Share
10 |10000 characters needed characters left characters exceeded
Dirty Rony Mar 13, 2017 at 03:09 PM
0

Abhilash

Your solution was right all along.

Somehow I had formated the field to supress if 0, hence the consistent mistake.

Sorry about that, and thank you again.

Share
10 |10000 characters needed characters left characters exceeded