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] Finding out a total for a ROW for only negative values.
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Finding out a total for a ROW for only negative values.
 Login/Join
 
Member
posted
I need to compute the a total for each row but only the negative values. In the example below, part AAAA does not have negative values in OH1 and OH2 so the total is 0 (or null). l if possible). Part BBBB has negative values in OH1 and OH2 is -5. Part CCCC has only one negative value in OH1 so the total is -4. Part DDDD has a negative value OH2 so the total is -03. I included the leading zeros in the example below just to keep the formatting. I have also included only two OHx fields but my report has 8 OHx fields.

Part OH1 OH2 TOT
AAAA 005 001 000
BBBB -03 -02 -05
CCCC -04 005 -04
DDDD 006 -03 -03

I appreciate your help.

Petter

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


WebFocus 7703
Windows, All Outputs
 
Posts: 11 | Registered: November 09, 2012Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Maybe something like this:

TABLE FILE xxxx
 SUM/PRINT
  OH1
  OH2
  OH3
  .
  .
  .
  COMPUTE OH1X/D9 = IF (OH1 LT 0) THEN OH1 ELSE 0 ;  NOPRINT
  COMPUTE OH2X/D9 = IF (OH2 LT 0) THEN OH2 ELSE 0 ;  NOPRINT
  COMPUTE OH3X/D9 = IF (OH3 LT 0) THEN OH3 ELSE 0 ;  NOPRINT
  .
  .
  .
  COMPUTE TOT/D9 MISSING ON = IF   (OH1X + OH2X + OH3X + .....) EQ 0 THEN MISSING
                              ELSE (OH1X + OH2X + OH3X + .....);
 BY PART
END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Reply With QuoteReport This Post
Member
posted Hide Post
Thank you! It did work!


WebFocus 7703
Windows, All Outputs
 
Posts: 11 | Registered: November 09, 2012Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Finding out a total for a ROW for only negative values.

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