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] Bottom 90 Percent of Values

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Bottom 90 Percent of Values
 Login/Join
 
Platinum Member
posted
I've got a list of values from my hold file, and I need to only display the bottom 90% of the records based on the sorting of one of the fields.

So I'm:
1. Calculating the number of records in the hold file, and assigning that to a variable.

2. Calculating 90% of the number that was assigned to the variable.

3. Sorting the output file on the same sort field that was used to calculate the number of records, and setting the recordlimit of the output file equal to the number resulting from step #2.

This gives me the correct number of records, but not the correct records based on the sort field.

Is this even possible?

My code:

TABLE FILE BASELINE
PRINT
CAGE_CODE AS 'CAGE_CODE'
CYCLE_DAYS AS 'CYCLE_DAYS'

WHERE CYCLE_DAYS NE 0

ON TABLE HOLD AS 'TOTAL01'
END
-RUN

-SET &TOTAL01= &RECORDS;
-SET &TOTAL01PCT= &RECORDS * .90;

TABLE FILE TOTAL01
PRINT
TOTAL01.CAGE_CODE AS 'CAGE_CODE'
TOTAL01.CYCLE_DAYS AS 'CYCLE_DAYS'

BY LOWEST CYCLE_DAYS NOPRINT

WHERE RECORDLIMIT EQ &TOTAL01PCT

ON TABLE PCHOLD FORMAT EXL2K 
END
-EXIT

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


Production - 7.6.4
Sandbox - 7.6.4
 
Posts: 241 | Location: Bethesda, MD | Registered: August 14, 2007Report This Post
Expert
posted Hide Post
You need to have the same BY in both TABLE FILEs...


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Maybe something like this:

TABLE FILE GGORDER
PRINT *
BY QUANTITY NOPRINT
ON TABLE HOLD AS H001
END
-RUN

-SET &TOTAL01    = &LINES;
-SET &TOTAL01PCT = &LINES * .90;

-TYPE &TOTAL01 &TOTAL01PCT

TABLE FILE GGORDER
PRINT *
BY QUANTITY NOPRINT

WHERE RECORDLIMIT EQ &TOTAL01PCT
HEADING
"Total Count: &TOTAL01 / 90%: &TOTAL01PCT"
END
-RUN


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
Thank you. That is working.


Production - 7.6.4
Sandbox - 7.6.4
 
Posts: 241 | Location: Bethesda, MD | Registered: August 14, 2007Report This Post
Virtuoso
posted Hide Post
CWM,

When I read the subject of your thread, I thought that you wanted the bottom 90% of the values of a field. Then after reading, I understood that you wanted the bottom 90% of records.

Just in case you are also interested in values, here is a possible solution:
-* File CWM01.fex
TABLE FILE GGORDER
SUM QUANTITY 
PRINT QUANTITY
COMPUTE CUMQUANT/I8=CUMQUANT + C2; 
COMPUTE PCTCUMQUANT/D7.2=CUMQUANT * 100 / C1; 
BY QUANTITY
WHERE TOTAL PCTCUMQUANT LE 90;
END


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Platinum Member
posted Hide Post
Danny-SRL

Thank you for the code. That was actually a question I had asked my customer earlier for clarification as well.

They are looking for the bottom 90% of records. So if there are 10 records that meet the criteria, they only want to see records 2-10.


Production - 7.6.4
Sandbox - 7.6.4
 
Posts: 241 | Location: Bethesda, MD | Registered: August 14, 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] Bottom 90 Percent of Values

Copyright © 1996-2020 Information Builders