Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] How to append brackets( '(' , ')') to string
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] How to append brackets( '(' , ')') to string
 Login/Join
 
Gold member
posted
Hi All,

I am facing problem with appending brackets to String in webfocus. below is my scenario.

In one of my table, one column having values in dollars(ex: $23,456,234.456).

While displaying i need to check whether it is in negative or not. If it is lessthan zero then i need to remove the -ve sign and need to add brackets to value.

I am doing this like below

COMPUTE T_STOCK_AMT1/A50 = IF T_STOCK_AMT LE 0.0 THEN FTOA(T_STOCK_AMT*-1, '(D20.2M)', T_STOCK_AMT1) ELSE FTOA(T_STOCK_AMT, '(D20.2M)', T_STOCK_AMT1);

where T_STOCK_AMT is the column name.

At last i am storing the value in "T_STOCK_AMT1". Now i need to add the brackets to T_STOCK_AMT1. I am trying like below

COMPUTE ASD/A50 = '(' | T_STOCK_AMT1 | ')';

But its not working.
can you please solve my problem......

Roll Eyes

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


Web FOCUS 7.7.03
PDF
 
Posts: 69 | Registered: May 24, 2013Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Does the field need to be a alpha format field?
Or would it better be an amount with all advantages of that and just show the way you want?

In that case try this

COMPUTE NEWVALUE/D15.2B=Tstockamt ;

You can also do this just in the report. Look in documentation and see how many format settings you have




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Reply With QuoteReport This Post
Gold member
posted Hide Post
Ya just now i found this in report painter before i saw your post.

If you don't mind can you provide me any tutorial regarding this???

Thankyou for your solution


Web FOCUS 7.7.03
PDF
 
Posts: 69 | Registered: May 24, 2013Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Santu,

I would strongly recommend the WebFOCUS Keysheet Release 8.0.2 available at www.aviter.com. It has all the formats of all fields laid out in a very fast quick lookup format. You can have it minimized as a PDF on your PC or tablet type device -- or of course the printed book version is also available.

You won't have to spend time "reading" - It is a quick lookup with everything right there --- You should check it out! Just might help you out quickly and SAVE you time.


Vivian Perlmutter
Aviter, Inc.


WebFOCUS Keysheet Rel. 8.0.2
(Almost) 1001 Ways to Work with Dates thru Rel. 8.0.2
Focus since 1982
WebFOCUS since the beginning
Vivian@aviter.com

 
Posts: 191 | Location: Henderson, Nevada | Registered: April 29, 2003Reply With QuoteReport This Post
Expert
posted Hide Post
Vivian,

Does the Key Sheet show how to use the FPRINT function with date columns?

Thanks,


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] How to append brackets( '(' , ')') to string

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.