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] Calculation based on results of Summary
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Calculation based on results of Summary
 Login/Join
 
Gold member
posted
I am not sure how to do define the CALC column.
See the sample data below


CONTRACT CLASS TYPE AMT CALC
A100 A A -200 0
A100 A B 100 0
B100 A A -100 -100
B100 A B 200 200


If the sum of the CONTRACT AMT is positive th CALC = AMT.
If the sum of the CONTRACT AMT is negative the CALC column = 0

In this example:
- Since Sum Contract A100 Amt = -100 the CALC would be 0
- Since Sum Contract B100 Amt = +100 the CALC would be the amt

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


Webfocus 7.6.4
Windows 2003 Server, SQL Server 2005
Excel, HTML , JavaScript ,and PDF.
Reportcaster, BID, Tomcat
 
Posts: 79 | Registered: May 02, 2006Reply With QuoteReport This Post
Virtuoso
posted Hide Post
A multi-set request is in order here. Try the following example:
FILEDEF DATA DISK DATA.MAS
-RUN
-WRITE DATA FILENAME=DATA, SUFFIX=FIX
-WRITE DATA FIELD=CONTRACT, FORMAT=A4, ACTUAL=A4, $
-WRITE DATA FIELD=CLASS   , FORMAT=A4, ACTUAL=A4, $
-WRITE DATA FIELD=TYPE    , FORMAT=A4, ACTUAL=A4, $
-WRITE DATA FIELD=AMOUNT  , FORMAT=I6, ACTUAL=A6, $

FILEDEF DATA DISK DATA.TXT
-RUN
-WRITE DATA A100   A   A  -200
-WRITE DATA A100   A   B   100
-WRITE DATA B100   A   A  -100
-WRITE DATA B100   A   B   200

TABLE FILE DATA
SUM AMOUNT
BY CONTRACT
SUM AMOUNT
    COMPUTE CALC/I6 = IF C1 LT 0 THEN 0 ELSE AMOUNT;
BY CONTRACT
BY CLASS
BY TYPE
END
Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 7 - IE11.
in Focus since 1988
 
Posts: 1960 | Location: Netherlands | Registered: September 25, 2007Reply With QuoteReport This Post
Gold member
posted Hide Post
Thanks GamP

I am so inept at the multi-verb statement! This should work


Webfocus 7.6.4
Windows 2003 Server, SQL Server 2005
Excel, HTML , JavaScript ,and PDF.
Reportcaster, BID, Tomcat
 
Posts: 79 | Registered: May 02, 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] Calculation based on results of Summary

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