Focal Point
compute results in leading zeroes?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4021077842

September 26, 2007, 01:56 PM
Jason K.
compute results in leading zeroes?
I have a compute of
COMPUTE MARGIN_BP/A15 = EDIT((((PROJECTED_MARGIN)/PROJECTED_SALES)) - (((EXT_SALES_DOLLARS - EXT_ACT_COST)/EXT_SALES_DOLLARS)) * 1000) | 'bp'; AS 'Margin,BP % to Goal'

that give me results like this
000000289bp
it seems to pad the result with leading zeroes. Is there a way to avoid this?


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
September 26, 2007, 01:59 PM
Prarie
Why is Margin_BP Alpha? oh never mind I see why...


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
I'm concatenating the 'bp' to the end of it.
nobody ever came up with a fancy symbol for basis points, but they really should have. Wink


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
You are getting the zeros because you are using the edit command. Is the 'bp' a must have for you? If so why not print the amount not changed and try a field containing the 'bp' in it printed at +0 of the other field?


Leah
Use the FTOA function:
TABLE FILE CAR
PRINT
COMPUTE MARGIN_BPN/D12 = (((SALES)/SEATS)) - (((DEALER_COST - RETAIL_COST)/DEALER_COST)) * 1000; NOPRINT
COMPUTE MARGIN_BP/A17 = FTOA(MARGIN_BPN, '(D12)', 'A15') | 'bp'; AS 'Margin,BP % to Goal'
END

I used two computes to get the result you want because I was getting an error with this:
TABLE FILE CAR
PRINT
COMPUTE MARGIN_BP/A15 = EDIT((((SALES)/SEATS)) - (((DEALER_COST - RETAIL_COST)/DEALER_COST)) * 1000) | 'bp'; AS 'Margin,BP % to Goal'
END

(FOC276) THE FIRST ARGUMENT OF 'EDIT' MUST BE A FIELDNAME


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
You done it Tom Flynn!

I had to make it two computes (one compute and it had no output at all)

COMPUTE MARGIN_BPX/A15 = EDIT((((PROJECTED_MARGIN)/PROJECTED_SALES)) - (((EXT_SALES_DOLLARS - EXT_ACT_COST)/EXT_SALES_DOLLARS)) * 1000) | 'bp'; AS 'Margin,BP % to Goal' NOPRINT
COMPUTE MARGIN_BP/A15 = TRIM('L',MARGIN_BPX,15,'0',1,'A15'); AS 'Margin,BP % to Goal'

I am giving Mr. Flynn 3,000,000 of my focal points. of course, they aren't worth anything (though, I think they may have a millionth of a penny street value?), but you have my admiration and respect.

thanks again!


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.