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     Rolling Calculation using ACROSS

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Rolling Calculation using ACROSS
 Login/Join
 
<Brian May>
posted
I could use a little help with a problem. I am creating a report of orders accross dates. For example:

__________Dates
__________6/23/2005_________7/1/2005
On Hand___Orders___+ or -____Orders____+ or -

7,500_____5,600____1,900_____2,500_____(600)

The problem is that I need to calculate the excess or shortage after each date. In otherwords, Excess = Excess@PrevDate - Orders@CurrentDate. I think I will have to use some kind of column based calculation but I am not sure how to go about it. Any help would be appreciated.

Thanks,

Brian

PS. Sorry about the underscores. Only way I knew to line up example
 
Report This Post
Gold member
posted Hide Post
If you are using FRL, then there is column based calculations, but I think in your case using LAST would be simpler. If this is actually with some other BY, then the Calculation for SEQ would be IF byfield EQ LAST byfield THEN SEQ + 1 ELSE 1;
Here's the code I used to get what you asked for:
TABLE FILE fn
SUM COMPUTE QTY_ON_HAND/I6 = 7500;
SUM ORDER
COMPUTE SEQ/I5 = LAST SEQ + 1; NOPRINT
COMPUTE QTY1/I6B = IF SEQ EQ 1 THEN QTY_ON_HAND - ORDER ELSE LAST QTY1 - ORDER; AS '+ OR -'
ACROSS DATE
END
 
Posts: 60 | Location: 2 penn | Registered: May 22, 2003Report This Post
<Brian May>
posted
Thanks!!!!!

That works beautifully. I did not know that there was a LAST keyword. That's a handy keyword to know.

Big Grin

Brian
 
Report This Post
<Brian May>
posted
Ok guys,

one more issue on this one. Like the previous post stated, the rolling calc works great. The complaint now from my users is that if a row has no orders for a date that is on another row on the across, the rolling calculation does not show. They would like to see a zero for orders column and the corresponding compute so that the totals for the report will include the overage or shortage for the date.

Thanks

Brian
 
Report This Post
Virtuoso
posted Hide Post
You need to supply the missing instances with zeros, before doing your TABLE with ACROSS.

The general approach:
Generate a full cartesian product of all row and column keys (products and dates); then use MATCH FILE to merge in the missing instances; and then you're ready to apply the ACROSS.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Guru
posted Hide Post
Or, if you know the range of values you want to display ... ACROSS COLUMNS 'date_value1' AND 'date_value2' AND ...
 
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003Report 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     Rolling Calculation using ACROSS

Copyright © 1996-2020 Information Builders