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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Null/Missing values
 Login/Join
 
Gold member
posted
I have two numeric fields in my SQL database, and I want to add them together in a define, like so:

GAINLOSS/D15.2=STGAINLOSS + LTGAINLOSS;

Then I want to select only records where GAINLOSS is NOT 0. So..

TABLE FILE something
PRINT stuff
WHERE GAINLOSS NE 0
END

Problem: This will only return records where there's a value in both STGAINLOSS and LTGAINLOSS. If either field is null (which this field can have null values, MISSING =ON in master file) it won't return the record. Even though the GAINLOSS defined field resolves to something other than zero. If I SUM GAINLOSS, I get the right results. What is going on? I've been all over the documentation, tried everything from SET ALL = PASS to MISSING = OFF to this crazy code:

SOMEDATA/I5 MISSING ON NEEDS SOME=RETURNS + DAMAGED (example from section 13-8 of Creating Reports with WF Lang)

Now, the obvious solution is to not have null values in those fields. In fact, I have a similar database with those exact fields that works fine because values are zero if missing. And I know I could redefine the fields. But I'm just really curious why this happens. And how to prevent it from happening to end users who don't have a clue it's happening.
 
Posts: 68 | Location: Springfield MA | Registered: May 07, 2003Report This Post
Guru
posted Hide Post
Give this a try:

SET NODATA = 0
TABLE FILE something
PRINT stuff
COMPUTE GAINLOSS/D15.2=STGAINLOSS + LTGAINLOSS;
WHERE TOTAL GAINLOSS NE 0
END
I don't think you will need the 'SET NODATA = 0'. But give it a try and lets see what happens.

This message has been edited. Last edited by: <Mabel>,
 
Posts: 406 | Location: Canada | Registered: May 31, 2004Report This Post
Gold member
posted Hide Post
Well this one's getting filed in my Duh folder!
All I was missing was the WHERE TOTAL.

Thank you!
 
Posts: 68 | Location: Springfield MA | Registered: May 07, 2003Report This Post
<Sugiyama>
posted
Hi Jen

I know the computational method of the missing value.

Please refer to the following.

DEFINE FILE something
-*** Pattern 1 ***
-*** Both are null
-*** STGAINLOSS + LTGAINLOSS = 0
GAINLOSS/D15.2=STGAINLOSS + LTGAINLOSS;

-*** Pattern 2 ***
-*** Either is null
-*** STGAINLOSS + LTGAINLOSS != 0
GAINLOSS/D15.2 MISSING ON=STGAINLOSS + LTGAINLOSS;

-*** Pattern 3 ***
-*** Neither is null
-*** STGAINLOSS + LTGAINLOSS != 0
GAINLOSS/D15.2 MISSING ON NEEDS ALL=STGAINLOSS + LTGAINLOSS;
END


Try that
Good luck
 
Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders