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     [SOLVED] MAX function or prefix whatever

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] MAX function or prefix whatever
 Login/Join
 
Platinum Member
posted
I am trying to get the MAX gift amount per person. Along with the corresponding gift code, gift designation, and gift date for that max gift. However when I put the MAX on the corresponding fields, it brings back the MAX based off of ABC order for that field. For example my max gift is 1000, with a designation of AFANNUAL. When I put the MAX on the desg field, it pulls back the designation with the latest letter of the alphabet, so let's just use ZEBRA as the designation. Also for the gift date, it is just bringing back the largest gift date, when I need the gift date of the largest gift. How can I achieve this?

This message has been edited. Last edited by: Kerry,


tbj
Prod WF 8.1.05,Test WF 8.1.05, WINDOWS 7 Platform, Oracle 12
Excel, PDF, Alpha
 
Posts: 132 | Location: Chapel Hill, NC | Registered: October 24, 2006Report This Post
Virtuoso
posted Hide Post
The Max. designation only refers to the field on which it is placed, not the entire record. So for example, if you use MAX.MODEL and MAX.RCOST, you get the maximum value for retail cost, and the maximum (alphabetically last since it is an alpha field) value for model, but those two values will NOT correspond to the same record.

There are a couple of ways around this. One would be to sort by HIGHEST, HOLD, and then use the FST. prefix. This is the easiest/most straightforward, but requires a hold file.

You could also use a compute like

COMPUTE MAXGIFTDATE/YYMD=IF AMOUNT EQ MAX.AMOUNT THEN GIFTDATE ELSE '00000000';

(but then if there are two gifts with the same max value, there might be a problem.)

Third option is to use some combination of WITHIN in a COMPUTE to get the maximum value within a specific sort field.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Platinum Member
posted Hide Post
Thanks so much! I knew there was a simple answer. I will use the first option. Thanks again, and have a good weekend!


tbj
Prod WF 8.1.05,Test WF 8.1.05, WINDOWS 7 Platform, Oracle 12
Excel, PDF, Alpha
 
Posts: 132 | Location: Chapel Hill, NC | Registered: October 24, 2006Report This Post
Guru
posted Hide Post
You can also use BY HIGHEST 1. This approach does not require anything else. No hold as and fst.


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
 
Posts: 398 | Registered: February 04, 2008Report This Post
Virtuoso
posted Hide Post
But if you use BY HIGHEST 1, it has to be the highest 1 WITHIN the sort group - person in this case. Otherwise you just get one record returned. That was my last suggestion.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report 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     [SOLVED] MAX function or prefix whatever

Copyright © 1996-2020 Information Builders