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] Repeating Ranks

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved] Repeating Ranks
 Login/Join
 
Gold member
posted
I am sorting a sum field descending with limit set to 100 and rank turned on, my goal is to see the top(largest) 100 records.

I've run into a slight issue, if two or more records have the same number they will hold the same ranking place.

Example:

Rank Quantity
1-------18
2-------12
3-------9
---------9
4-------8
5-------2

I don't want 9 to be listed twice under rank 3, I want the first on to display 3 and the second 4.

Example:

Rank Quantity
1-------18
2-------12
3-------9
4-------9
5-------8

(Ignore the dashes, the spaces where getting deleted so I needed to put something there to keep everything spaced correctly)

I only have access to InfoAssist no code, so it must be done entirely in InfoAssist, Any Ideas? Thanks.

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


WebFocus 8.2, IA+, Windows 10, HTML
 
Posts: 56 | Location: UT | Registered: December 01, 2015Report This Post
Master
posted Hide Post
You have to make your own counter...

...or just put everything in a hold and then use a new table with RECORDLIMIT EQ 100

Good luck,
dave


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Gold member
posted Hide Post
Thank you for the reply! Could you elaborate on how to make a counter field, I see it in other places in the forum but it uses the word WITH in the define and InfoAssist is not having that.


WebFocus 8.2, IA+, Windows 10, HTML
 
Posts: 56 | Location: UT | Registered: December 01, 2015Report This Post
Expert
posted Hide Post
Cimmerian,
A simplistic way is to use the LIST verb, here is an example(notice the 2nd SORT):

TABLE FILE GGSALES
LIST
DOLLARS
BUDUNITS
BUDDOLLARS
BY CATEGORY
BY HIGHEST DOLLARS NOPRINT
ON TABLE HOLD
END
-RUN
?FF HOLD
-RUN
TABLE FILE HOLD
PRINT *
BY CATEGORY NOPRINT
BY HIGHEST DOLLARS NOPRINT
WHERE LIST LE 100;
END
-EXIT

The other way is to set a counter and reset on the SORT column:

TABLE FILE GGSALES
PRINT
DOLLARS
BUDUNITS
BUDDOLLARS
COMPUTE CNTR/I4 = IF CATEGORY EQ LAST CATEGORY THEN CNTR + 1 ELSE 1;
BY CATEGORY
BY HIGHEST DOLLARS NOPRINT
ON TABLE HOLD
END
-RUN
?FF HOLD
-RUN
TABLE FILE HOLD
PRINT *
BY CATEGORY NOPRINT
BY HIGHEST DOLLARS NOPRINT
WHERE CNTR LE 100;
END
-EXIT

hth


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Master
posted Hide Post
So many ways to do things in WF. Here's another suggestion - a bit more abstruse: Introduce deliberate fractional inequalities in your values.

1) Create a new variable the same as your quantity

2) Use one of the random number subroutines available to create a very small fractional number.

3) Add that to your new variable, so a value like 10 would become 10.000001234 and another 10 would become 10.000005678

4) Run the fex with RANKED BY the new variable NOPRINT

TABLE FILE XYZ
PRINT QUANTITY
RANKED BY NewVariable NOPRINT
....
....
END


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
Gold member
posted Hide Post
Thank you for all the replies! I appreciate all the help, I found George Patton's solution to be the most simple (I was overthinking this) and worked like a charm! Thanks again everybody, I will mark this as solved


WebFocus 8.2, IA+, Windows 10, HTML
 
Posts: 56 | Location: UT | Registered: December 01, 2015Report 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] Repeating Ranks

Copyright © 1996-2020 Information Builders