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  iWay Software Product Forum on Focal Point    [CLOSED] Second Max Value

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Second Max Value
 Login/Join
 
Member
posted
Hi Experts,

I have a report that returns the Max value from 24 samples, but I need to discard the maximum value and get the second max value.

SUM MAX.UNIT_LOAD_RNC.UNIT_LOAD_RNC.PEAK_LOAD/D20 AS 'PEAK'
BY UNIT_LOAD_RNC.UNIT_LOAD_RNC.RNC_NAME

Any help appreciated,

Luciano

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


WebFOCUS 8.0.06
Windows, All Outputs
 
Posts: 3 | Registered: September 24, 2014Report This Post
Virtuoso
posted Hide Post
This example using the CAR file may help:

TABLE FILE CAR
 SUM SALES
 RANKED BY HIGHEST 2 COUNTRY
 WHERE TOTAL RNK.COUNTRY EQ 2 ;
END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Master
posted Hide Post
Dan is on the right track. I think you will have to do a HOLD with the top two values and then take the lesser of those two values for you final number.

You could also try sorting your data by the values and then use the LAST keyword to extract the value previous to the max.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report This Post
Member
posted Hide Post
Hi guys thank both of you for the tips. We are almost there.

Unfortunetely it is not going to work.
I'll try to explain using the anology below.

For each day we have 24hours, so I need to very each hour per day and get the second max Speed for each car.

If we use the sugestion:
RANKED BY HIGHEST 2 MAXSPEED
WHERE TOTAL RNK.MAXSPEED EQ 2 ;

The report will return only Porsche car.


Eg:
RANK MAXSPEED CAR 01/11/15 02/11/2015 03/11/2015
1 200 FERRARI 200 180 98
2 190 PORSCHE 100 190 120
3 180 MUSTANG 180 110 120
...
x


WebFOCUS 8.0.06
Windows, All Outputs
 
Posts: 3 | Registered: September 24, 2014Report This Post
Virtuoso
posted Hide Post
Add BY CAR if you want the second highest number for each car:

TABLE FILE CAR
 BY CAR
 RANKED BY HIGHEST 2 SALES
 WHERE TOTAL RNK.SALES EQ 2 ;
END

This assumes your 24 hours of data is vertical (one entry for each hour) instead of horizontal (each entry has 24 hour buckets).


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [CLOSED] Second Max Value

Copyright © 1996-2020 Information Builders