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     [CLOSED] Problem printing Decimal and Text Under Same Column Name

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Problem printing Decimal and Text Under Same Column Name
 Login/Join
 
Gold member
posted
Hi

I have Rate(%) Column and Date Column in a report and there is a Scenario where these come out to be null.
The user requires me to print keyword 'Pending' instead of a Blank cell value Where Rate(%)/Date is null.
I am not able to handle it using IF in a Define.
I want something like:

-*RATE/D20.2= IF RATE IS MISSING THEN 'PENDING' ELSE RATE ;
-*RATE/A20 = IF RATE IS MISSING THEN 'PENDING' ELSE RATE;


this leads to a Data Type Mismatch, the first line of code cannot store 'Pending', the second line cannot store RATE as it is D20.2.

In the end report i need to show

RATE
0.8
0.9
Pending
Pending

Please Help Guys!

This message has been edited. Last edited by: <Kathryn Henning>,


Webfocus 8105,8808,7703,7611, EXL2K,HTML,PDF,COMT,AHTML Info Assist+ , Reportcaster
 
Posts: 64 | Location: Toronto, Ontario | Registered: May 15, 2014Report This Post
Virtuoso
posted Hide Post
Use FPRINT to convert the RATE field to A20. There are plenty of examples on the Forum.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Master
posted Hide Post
You could also use SET NODATA="Pending" . This will set all null values to whatever value you specify.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
 
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013Report This Post
Gold member
posted Hide Post
I implemented SET NODATA = 'Pending'.
I'll also check the FPRINT if it does not remove the Leading 0 from the Decimal.


Webfocus 8105,8808,7703,7611, EXL2K,HTML,PDF,COMT,AHTML Info Assist+ , Reportcaster
 
Posts: 64 | Location: Toronto, Ontario | Registered: May 15, 2014Report This Post
Virtuoso
posted Hide Post
Post your code...


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: 2410 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Virtuoso
posted Hide Post
You can also use dynamic formatting, search the forum for details.

It boils down to something like this:
DEFINE FILE FOO
  RATEFMT/A8 = IF RATE IS MISSING THEN 'A20' ELSE 'D12.2';
END
TABLE FILE FOO
PRINT COMPUTE RATEX/RATEFMT = IF RATE IS MISSING THEN 'Pending' ELSE RATE;
END


It's a bit tricky to get to work. For example, the format-field HAS to be of type A8, no smaller or larger, or it won't work.

FPRINT is definitely easier to get to work. Often I accompany it with a flag-field for conditional styling - text is left-justified, numbers right-justified. Does the trick.

The only issue with FPRINT is if you export the data to a format where calculations are done on the result, but I sure hope nobody plans to do so if some of the values can contain 'Pending'!


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report 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     [CLOSED] Problem printing Decimal and Text Under Same Column Name

Copyright © 1996-2020 Information Builders