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]Calculation Between Next Row and Current Row

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]Calculation Between Next Row and Current Row
 Login/Join
 
Member
posted
Hello,

I am looking for a keyword that will let me grab the value of the next row to use in a calculation in the current row. There is already a keyword for the last row but I can't seem to find it after looking through documentation. We would like to avoid using hold files at all.

example:

TABLE FILE CAR
SUM
DEALER_COST
COMPUTE TEST/D12 = DEALER_COST + LAST DEALEAR_COST; AS TEST
-*COMPUTE TEST2/D12 = NEXT DEALER_COST - DEALER_COST; AS TEST2
BY CAR
END

Please let me know if this is something possible in version 8.

Thank you,

Michael

This message has been edited. Last edited by: <Emily McAllister>,
 
Posts: 1 | Registered: June 08, 2015Report This Post
Virtuoso
posted Hide Post
As far as I know there is no NEXT row. But using the LAST should be possible, it's just a question of processing where you should only have to "invert" your logic.

It is a question of "did I skiped the fence already and have to look behind or will I skip and look after". According to me, it's easier to know what has happened then knowing what is going to happen...

So I'm pretty sure that is feasible with LAST.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Master
posted Hide Post
There is no NEXT logic. Use of NEXT or LAST logic implies that a time component is either implied or is an explicit part of the order of the data. Just reverse that so the most recent rows are first then you can use LAST. I do it all the time.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Gold member
posted Hide Post
Give this a shot.

TABLE FILE CAR
SUM CAR AS 'NXTCAR'
COMPUTE LSTCAR/A16=LAST CAR;
BY COUNTRY NOPRINT
BY CAR NOPRINT
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS NXTCAR FORMAT FOCUS INDEX LSTCAR
END
-RUN
JOIN CAR IN CAR TO LSTCAR IN NXTCAR
-RUN
TABLE FILE CAR
SUM SALES NXTCAR
BY COUNTRY
BY CAR
END


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 74 | Registered: December 23, 2013Report 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]Calculation Between Next Row and Current Row

Copyright © 1996-2020 Information Builders