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.

New TIBCO Community Coming Soon
In early summer, TIBCO plans to launch a new community—with a new user experience, enhanced search, and expanded capabilities for member engagement with answers and discussions! In advance of that, the current myibi community will be retired on April 30. We will continue to provide updates here on both the retirement of myibi and the new community launch.

What You Need to Know about Our New Community
We value the wealth of knowledge and engagement shared by community members and hope the new community will continue cultivating networking, knowledge sharing, and discussion.

During the transition period, from April 20th until the new community is launched this summer, myibi users should access the TIBCO WebFOCUS page to engage.


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: 2410 | 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