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     [CLOSED] Problem printing Decimal and Text Under Same Column Name
Go
New
Search
Notify
Tools
Reply
  
[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: 54 | Location: Toronto, Ontario | Registered: May 15, 2014Reply With QuoteReport 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, 2007Reply With QuoteReport 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, 2013Reply With QuoteReport 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: 54 | Location: Toronto, Ontario | Registered: May 15, 2014Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Post your code...


WF versions : Prod 8.2.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2084 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport 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: 1639 | Location: Enschede, Netherlands | Registered: August 12, 2010Reply With QuoteReport This Post
  Powered by Social Strata  
 

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-2018 Information Builders, leaders in enterprise business intelligence.