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] Getting rid of leading 0s in an EDIT function

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Getting rid of leading 0s in an EDIT function
 Login/Join
 
Gold member
posted
I am using an EDIT function on some numbers because I need to concatenate them with a string.

 DEFINE FILE file
TABLEDATA/A700 = '''' || TIME_UNIT || '''' || ',' || EDIT(ACTIVE_PAID, '$$$$$$$$999999') || ',' || EDIT(TOTAL_PAID, '$$$$$$$$99999') || ',' || EDIT(TOTAL_ACCEPTED, '$$$$$$$99999') || ',' || EDIT(FILE_COMPLETE, '$$$$$$$$99999') || ',' || EDIT(TOTAL_APPLIED, '$$$$$$99999')
END
 


My TIME_UNIT outputs Fall (20xx).

I am taking all this data and putting it into an array because I'm using the Google Charts API which takes its data through an array. Here's the array data

['Fall 2015',661,799,3089,387,08311],
['Fall 2016',577,684,2992,358,08601],
['Fall 2017',567,684,3050,492,10025],
['Fall 2018',695,819,3522,639,12097],
['Fall 2019',015,015,0130,727,01556],


As you can see, with my edits I've gotten the leading zeros down for the most part, but the very last column is giving me troubles with data. Because of the leading zeros in front of the 1556, the data is displaying differently than the way it should. Is there a way to get rid of these 0s? Perhaps with another function?

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


WebFOCUS 8.2.01M on Windows 10
 
Posts: 54 | Registered: July 30, 2018Report This Post
Expert
posted Hide Post
Use FPRINT or the newer EDIT2 function.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
Try with this instead. Adjust length as requested. The alpha format must better be larger than the numeric one.
DEFINE FILE file
TABLEDATA/A700 = '''' || TIME_UNIT || '''' || ',' || LJUST(16, FPRINT(ACTIVE_PAID, 'I14', 'A16'), 'A16V)) || ',' || LJUST(16, FPRINT(TOTAL_PAID, 'I14', 'A16'), 'A16V') || ',' || LJUST(16, FPRINT(TOTAL_ACCEPTED, 'I14', 'A16'), 'A16V') || ',' || LJUST(16, FPRINT(FILE_COMPLETE, 'I14', 'A16'), 'A16V') || ',' || LJUST(16, FPRINT(TOTAL_APPLIED, 'I14, 'A16'), 'A16V');
END


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Gold member
posted Hide Post
Instead of doing it inside of WebFOCUS, I actually just edited a stored procedure I was using to output the data into strings.


WebFOCUS 8.2.01M on Windows 10
 
Posts: 54 | Registered: July 30, 2018Report This Post
Master
posted Hide Post
Personally I would use the FTOA function
 
DEFINE FILE CAR
TABLEDATA/A700V='[''' || MODEL || '''' || ',' || FTOA(DEALER_COST,'(D12c)','A15V') || ',' || FTOA(RETAIL_COST,'(D12c)','A15V') || ',' || FTOA(SALES,'(D12c)','A15V') || ']' ; 
END

TABLE FILE CAR
PRINT TABLEDATA AS ''
ON TABLE SET PAGE-NUM OFF
END

-RUN
 


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report 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] Getting rid of leading 0s in an EDIT function

Copyright © 1996-2020 Information Builders