Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Leading and trailing zeros

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Leading and trailing zeros
 Login/Join
 
Silver Member
posted
Hi,

I know that there is a lot of info out there on this subject but I can't quite find exactly what I'm looking for.

I have a A15 field (000000005930000), I need it to look like 59.30. I can trim the leading zeros, but if I trim trailing then I get 593. I need to keep one trailing zero.

Any suggestions? Thanks.

This message has been edited. Last edited by: Kerry,


WEBFOCUS 7.14
WEBFOCUS.8.04
 
Posts: 44 | Registered: March 30, 2007Report This Post
Expert
posted Hide Post
Once you've trimmed the leading zeroes, couldn't you use EDIT to pick up what now are the first 4 characters and insert the dot?
TRIM4/A5=EDIT(TRIMMED,'99.99');


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
<JG>
posted
I think what CathyB means she gets 59.3 but wants 059.3

If that is the case then its '0' || the trimed field
 
Report This Post
Silver Member
posted Hide Post
Thank you thats really close, but I failed to mention that this field varies, one is the exsample I gave and then I could have (000000012530000) which should translate to 125.30. I could have others that (0000000112530000) which would be 1125.30. Basically this a A15 field that needs to be a D12.2 field trimming the leading zeros and all but one zero on the end.


WEBFOCUS 7.14
WEBFOCUS.8.04
 
Posts: 44 | Registered: March 30, 2007Report This Post
Gold member
posted Hide Post
If the format of the alpha field is always the same then just convert field to numeric and divide by 100000.

 
DEFINE FILE CAR
NMX/A15 = '000000005930000';
NM/D15.2 = EDIT(NMX)/100000.00;
END
TABLE FILE CAR
PRINT CAR 
NM
IF RECORDLIMIT EQ 1
END


WF 8.2.01M
8.2.01M Reporting Server
Windows 2012 Srvr R2
PDF,Excel, HTML
Graphs - a lot of graphs
 
Posts: 60 | Location: Atlanta, GA | Registered: October 30, 2003Report This Post
Silver Member
posted Hide Post
Wow, that was like hitting the "easy" button. Thank you!


WEBFOCUS 7.14
WEBFOCUS.8.04
 
Posts: 44 | Registered: March 30, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Leading and trailing zeros

Copyright © 1996-2020 Information Builders