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     Formatting Decimals For Different Rows of the Same Column

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Formatting Decimals For Different Rows of the Same Column
 Login/Join
 
Member
posted
Hello,

I have data that always comes back in four rows. The first column is text and is unique. The second column is a numerical value. I need to show the numbers of the first three rows with no decimal place, but the forth row must show two decimal places. Can anyone help?


Grant


Grant
Oracle 9, Web Focus Version 7.6.1
 
Posts: 19 | Registered: August 02, 2007Report This Post
Guru
posted Hide Post
Grant -
Here is a link to a discussion about varying the format.

link


jimster06
DevStu WF 7.6.11
W7
HTML, PDF, EXL2K
 
Posts: 252 | Location: USA | Registered: April 15, 2003Report This Post
Member
posted Hide Post
Thanks for the info. I use stored procedures and not master files, so I am not sure on where I should be placing the formatting code. Here is a sample of the beginning of my fex file:

-DEFAULT &INDATE = 'DATENOW'
-DEFAULT &FMT = 'PDF'
ENGINE SQLORA SET DEFAULT_CONNECTION DATABASE_NAME
ENGINE SQLORA EX STORED_PROCEDURE_NAME '&INDATE';
-RUN
TABLE FILE SQLOUT

PRINT
PRODUCT AS ''
DAILY_AMOUNT/MYFORMAT AS 'Daily,Amount'
DAILY_PLAN/D20 AS 'Plan'
PLAN_VALUE/D20 NOPRINT
WEEKLY_AVG/D20.1 AS 'Weekly,Avg'

Where would I place the following code so that the DAILY_AMOUNT column is formatted with my custom formatting?

MYFORMAT/D20 = DECODE PRODUCT('Truck Sales' 'D20.4' ELSE 'D20.1')


Thanks,


Grant


Grant
Oracle 9, Web Focus Version 7.6.1
 
Posts: 19 | Registered: August 02, 2007Report This Post
Virtuoso
posted Hide Post
DEFINE FILE SQLOUT
quote:
MYFORMAT/D20 = DECODE PRODUCT('Truck Sales' 'D20.4' ELSE 'D20.1');

END

TABLE FILE SQLOUT
...


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
Member
posted Hide Post
I now recieve this error:

FORMAT ERROR IN DECODE OR FILE ELEMENT: 'D20.2'

The PRODUCT column will always return text, so I'm not sure if this decode statement will work to try to format the other columns.


-Grant


Grant
Oracle 9, Web Focus Version 7.6.1
 
Posts: 19 | Registered: August 02, 2007Report This Post
Expert
posted Hide Post
small typo. the define should be:

  
MYFORMAT/A8 = DECODE PRODUCT('Truck Sales' 'D20.4' ELSE 'D20.1');


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, 2005Report This Post
Member
posted Hide Post
Excellent, that worked! Thanks all for all your help.


Grant


Grant
Oracle 9, Web Focus Version 7.6.1
 
Posts: 19 | Registered: August 02, 2007Report This Post
Virtuoso
posted Hide Post
Grant

I think you need to do something with a counter in combination with the above formating function, unless the 4 the row is based upon the value of the first (text) value.




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, 2006Report This Post
Member
posted Hide Post
Yeah, the number of decimal places depends on what the value of PRODUCT is only, so I think this will work out fine.


Grant


Grant
Oracle 9, Web Focus Version 7.6.1
 
Posts: 19 | Registered: August 02, 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     Formatting Decimals For Different Rows of the Same Column

Copyright © 1996-2020 Information Builders