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     [CLOSED] Cumulative sum

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Cumulative sum
 Login/Join
 
Member
posted
Hello All,
In my report i have a requirement to calculate cumulative sum.
Exampl:
My table has one month data, from 1st to 30th.and in my report i have to calculate week_to_date and Month_to_date. Something like partition by clause in Oracle. Since i am using access database i am unable to do it in backend. Please help/guide me to achive this.

Thanks In advance

This message has been edited. Last edited by: Kerry,
 
Posts: 4 | Registered: July 09, 2010Report This Post
Platinum Member
posted Hide Post
Hi,

Lot of ways you could do this...
You can use Multiverb request with 2 SUMs at 2 diff BY levels..
COMPUTE/DEFINE fields for summing at WTD or MTD level..
It all depends on the data in your source..if the data is at day level ...you could SET amper variables for WTD and MTD date components and use them in DEFINE or use them in WHERE if you go the multiverb way.

  
DEFINE FILE FILENAME
WTD/D12.2 = IF SOURCE_DATE FROM '&WEEK_BEGIN' TO '&WTD' THEN AMOUNT ELSE 0;
MTD/D12.2 = IF SOURCE_DATE FROM '&MONTH_BEGIN' TO '&MTD' THEN AMOUNT ELSE 0;
END
TABLE FILE FILENAME
SUM
WTD
MTD
END



thanks
Sashanka


WF 7.7.03/Windows/HTML,PDF,EXL
POC/local Dev Studio 7.7.03 & 7.6.11
 
Posts: 103 | Registered: June 12, 2009Report This Post
Member
posted Hide Post
Thanks for the reply Sashanka.

What i was looking for is,I should have a final focus file which has all the dates from 1 to 30th and Week_to_date and Month_to_date calculated with respect to each date. so, if apply a filter on 15th the WTD,MTD should be calculated w.r.t 15th..

Thanks For the help


W.F 769
Unix,Windows
Excel, HTML, PDF,AHTML
 
Posts: 4 | Registered: July 09, 2010Report This Post
Master
posted Hide Post
Renji,

Try something like this:

TABLE FILE whatever
SUM AMOUNT
    COMPUTE WTD/D12 = IF FST.WEEK EQ LAST FST.WEEK THEN WTD + AMOUNT ELSE AMOUNT;
    COMPUTE MTD/D12 = IF FST.MONTH EQ LAST FST.MONTH THEN MTD + AMOUNT ELSE AMOUNT;
BY  DATE
BY  WEEK NOPRINT
BY  MONTH NOPRINT
END


Greets, Dave


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Virtuoso
posted Hide Post
quote:
Originally posted by Dave:
Renji,

Try something like this:

TABLE FILE whatever
SUM AMOUNT
    COMPUTE WTD/D12 = IF FST.WEEK EQ LAST FST.WEEK THEN WTD + AMOUNT ELSE AMOUNT;
    COMPUTE MTD/D12 = IF FST.MONTH EQ LAST FST.MONTH THEN MTD + AMOUNT ELSE AMOUNT;
BY  DATE
BY  WEEK NOPRINT
BY  MONTH NOPRINT
END


Greets, Dave


Shouldn't that be like below?:
    COMPUTE WTD/D12 = IF FST.WEEK EQ LAST FST.WEEK THEN LAST WTD + AMOUNT ELSE AMOUNT;
    COMPUTE MTD/D12 = IF FST.MONTH EQ LAST FST.MONTH THEN LAST MTD + AMOUNT ELSE AMOUNT;


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Master
posted Hide Post
Hi, Wep5622.

Yes, that's what you'd expect.

But for some reason WF doesn't mind.
I guess because it's not a real column. Just some local variable the engine uses to create the compute. Refering to it seem to simply return whatever it is at that moment.

TABLE FILE CAR
	SUM	SALES
		COMPUTE CUM_SALES/D12 = CUM_SALES + SALES;
		COMPUTE CUM_SALES_2/D12 = LAST CUM_SALES_2 + SALES;
	BY	CAR
END



Groeten, Dave
Are you going to BI-Symposium next week?


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Member
posted Hide Post
Thanks all for the help ...


W.F 769
Unix,Windows
Excel, HTML, PDF,AHTML
 
Posts: 4 | Registered: July 09, 2010Report 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     [CLOSED] Cumulative sum

Copyright © 1996-2020 Information Builders