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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Cumulative $ [Solved]

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Cumulative $ [Solved]
 Login/Join
 
Silver Member
posted
-DEFAULT &FROMDT ='2010/03/14'
-DEFAULT &TODT ='2010/03/26'

TABLE FILE AAA
SUM COSTAMT
BY COSTDT
WHERE COSTDT GE '&FROMDT' AND COSTDT LE '&TODT';
END

OUTPUT of the above code:
COSTDT COSTAMT
2010/03/18 1424.6900
2010/03/22 31293.2500
2010/03/23 8429.5600
2010/03/24 8653.3200
2010/03/25 11015.5500

In this code I am summing the COSTAMT for each date. Instead I want the COSTAMT field to be cumulative sum, which means 2010/03/18 will have 1424.6900, next 2010/03/22 should be '31293.2500 + 1424.6900' (COSTAMT for 2010/03/22 + COSTAMT for 2010/03/18). So my final output should look like this :

COSTDT COSTAMT
2010/03/18 1424.6900
2010/03/22 32717.9400
2010/03/23 41147.5000
2010/03/24 49800.8200
2010/03/25 60816.3700

How do I do this? Help in the form of code would very useful.

This message has been edited. Last edited by: Shubha Manjit,


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 29 | Registered: February 21, 2011Report This Post
<FreSte>
posted
Help is already available in this forum, see here (Running Total)


but for your example it would be something like this:

FILEDEF CDATA DISK CDATA.MAS
-RUN
-WRITE CDATA FILENAME=CDATA, SUFFIX=FIX, $
-WRITE CDATA SEGNAME=CDATA, SEGTYPE=S1, $
-WRITE CDATA   FIELD=COSTDT,       ALIAS=E01,    FORMAT=YYMD   ,$
-WRITE CDATA   FIELD=COSTAMT,      ALIAS=E02,    FORMAT=D12.4   ,$

FILEDEF CDATA DISK CDATA.FTM
-RUN
-WRITE CDATA 20100322  31293.2500
-WRITE CDATA 20100323   8429.5600
-WRITE CDATA 20100318   1424.6900
-WRITE CDATA 20100324   8653.3200
-WRITE CDATA 20100325  11015.5500

TABLE FILE CDATA
  SUM
    COMPUTE RUNNING_TOTAL/D12.4 = LAST RUNNING_TOTAL + COSTAMT;
  BY COSTDT
END
 
Report This Post
Silver Member
posted Hide Post
Thank you so much. This works perfectly. I dint know the right term to look for it 'Running Total'


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 29 | Registered: February 21, 2011Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Cumulative $ [Solved]

Copyright © 1996-2020 Information Builders