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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
MAX vs LST
 Login/Join
 
Platinum Member
posted
Okay, this is the situation, I need to use a function that will retrieve a set of fields from a table that has repeating rows and a given identifier. For example:

CARTYPE CARNAME CARDATE CARPHONE CARLETTER
A ALPHA 10/1/2006 PHONE1 X
A ALPHA 10/2/2006 PHONE2 Y
B BETA 10/1/2006 PHONE3 X
B BETA 10/3/2006 PHONE4 Z
C CHI 10/4/2006 PHONE5 Z

Okay, if I ran the following script
TABLE FILE CARDATA
SUM
MAX.CARTYPE
CARNAME
CARDATE
CARPHONE
BY CARID
END

Would that get each item accordingly or would I have to put MAX. in front of each field?

Also, would that be the same thing as using the LST. prefix?

Thanks! this one has been really hounding me so I want to make sure I'm using the right one! It's either this or using various holds and matching them to a base table!

This message has been edited. Last edited by: gregson06,
 
Posts: 87 | Registered: August 03, 2006Report This Post
Guru
posted Hide Post
It depends on what you want. LST depends on how the table is sorted. The data you show is sorted by Cartype alphabetically. So LST will get you the same results as MAX will. If your real data is not sorted that way, the results would be different.


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
 
Posts: 391 | Location: California | Registered: April 14, 2003Report This Post
Platinum Member
posted Hide Post
Well that's just the thing, there can be multiple entries that only change by date, however if I only wanted the last entry for each record sorted by type, would I use LST to get the last transaction for that type? If I had an order of preference for if a certain type is available then I should get that one, other wise go to the next one? It just so happens the order I'd like to retrieve them is C then B then A, which goes with the MAX usage, is it okay to do so?

Thanks!
 
Posts: 87 | Registered: August 03, 2006Report This Post
Platinum Member
posted Hide Post
If you want one line of data for each date / type combination, use your sort fields. For the last entry for each type, try

PRINT
fieldnames
BY HIGHEST CARTYPE
BY HIGHEST 1 CARDATE


WF 7.6.11
Output: HTML, PDF, Excel
 
Posts: 123 | Location: UK | Registered: October 09, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders