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] DEFINE field not computing
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] DEFINE field not computing
 Login/Join
 
Gold member
posted
I am doing a define as..

field1 + field2 + field3.

All fields are D20.2

if it is 1+1+1 it works, however sometimes tehre are nulls.. so 1+null+1. Technically a null answer is correct, however i need that to be 2 Smiler . HOw can i configure the field to ignore nulls?

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


AS Version: 8201
Gen: 10202016
Windows, All Outputs
 
Posts: 49 | Location: St. Louis | Registered: December 13, 2016Reply With QuoteReport This Post
Expert
posted Hide Post
MISSING values give me a pain in the DEFINE FILE.

You may have to check each field for MISSING and cater for it.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6303 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Can you default a null with 0 in the previous hold?


Cheers,
H.

WebFOCUS 8.1.05M
Oracle 11g - DB2
RedHat
 
Posts: 115 | Location: Brighton UK | Registered: February 19, 2005Reply With QuoteReport This Post
Virtuoso
posted Hide Post
How about using an IF THEN ELSE to substitute? Something like this:

FIELD_1A/I9=IF FIELD_1 EQ MISSING THEN 0 ELSE FIELD_1;
FIELD_2A/I9=IF FIELD_2 EQ MISSING THEN 0 ELSE FIELD_2;
FIELD_3A/I9=IF FIELD_3 EQ MISSING THEN 0 ELSE FIELD_3;

NEW_FIELD/I9=FIELD_1A + FIELD_2A + FIELD_3A;
  


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Try the DEFINE with MISSING OFF.

FIELDT1/D20.2 MISSING OFF = FIELD1 + FIELD2 + FIELD3 ;

Working example CAR file:
DEFINE FILE CAR
  FIELD1/D20.2              = 1 ;
  FIELD2/D20.2 MISSING ON   = MISSING ;
  FIELD3/D20.2              = 1 ;
  FIELDT1/D20.2 MISSING OFF = FIELD1 + FIELD2 + FIELD3 ;
  FIELDT2/D20.2 MISSING ON  = FIELD1 + FIELD2 + FIELD3 ;
END

TABLE FILE CAR
  PRINT 
    COUNTRY
    FIELDT1 AS 'with MISSING OFF' ;
    FIELDT2 AS 'with MISSING ON' ;
  IF RECORDLIMIT EQ 1
END


Output:
COUNTRY  with MISSING OFFF  with MISSING ON
ENGLAND  2.0                .


Regards. Mikel.


WebFOCUS 8.1.05, 8.2.01
 
Posts: 173 | Location: Madrid, Spain | Registered: May 09, 2003Reply With QuoteReport This Post
Gold member
posted Hide Post
{SOLVED} thanks!


AS Version: 8201
Gen: 10202016
Windows, All Outputs
 
Posts: 49 | Location: St. Louis | Registered: December 13, 2016Reply With QuoteReport This Post
Expert
posted Hide Post
Please edit your first post in this thread and add [SOLVED] to the title.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6303 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] DEFINE field not computing

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