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     FML Help - Running Total of Columns

Read-Only Read-Only Topic
Go
Search
Notify
Tools
FML Help - Running Total of Columns
 Login/Join
 
Platinum Member
posted
I am trying to rebuild a report that was created in excel in WebFOCUS.

The report contains 26 weeks of data, each in a different field. I am trying to use FML to calculate some values with this data, one of which is a running average of the total (i.e. the current weeks value plus all preceding weeks divided by the number of weeks).

Is there an easier way of doing this than:

RECAP TST0(1)=L4; OVER
RECAP TST0(2)=(L4(1)+L4(2))/2; OVER
RECAP TST0(3)=(L4(1)+L4(2)+L4(3))/3; OVER


WF 7.6.11
Output: HTML, PDF, Excel
 
Posts: 123 | Location: UK | Registered: October 09, 2003Report This Post
Virtuoso
posted Hide Post
Tewy,

Nobody seems to have picked up the gauntlet. Would you care to run the following? It might be your answer without having to use FML:
  
-* File Tewy.fex
TABLE FILE CAR
PRINT SALES
COMPUTE ACCSALES/I7=SALES + ACCSALES; 
COMPUTE NUM/I3=1 + NUM; 
COMPUTE RUNAVESALE/I5=ACCSALES / NUM;
BY COUNTRY BY CAR BY MODEL
END


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Platinum Member
posted Hide Post
Thanks for the suggestion, but as I'm doing some other calculations I need to use FML.

I have now individually coded each of the 26 weeks (yawn), but thought there must be an easier way.

I'm new to FML so can't help wondering if I'm doing things the long way.


WF 7.6.11
Output: HTML, PDF, Excel
 
Posts: 123 | Location: UK | Registered: October 09, 2003Report This Post
Expert
posted Hide Post
Tewy,

In the RECAP syntax you can use label(start,end,step) with the subsequent code specifying offsets, it's something like -

RECAP TST0(1,3,1) = (L4(*-1) + L4(*)) / 2; OVER

Search for "Performing Inter-Row Calculations" or "Recursive" in the manual or something similar. I don't have the manual with me at home.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report 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     FML Help - Running Total of Columns

Copyright © 1996-2020 Information Builders