IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    HIGHEST function not working for me
Go
New
Search
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Platinum Member
Posted
[SOLVED] In a FEX, I've got three fields and I want to be able to print my highest student count by college. However, my counts are not coming out the way I want them, going highest to lowest. What am I doing wrong? Here is my code snippet:

STDCNT  /I06 = IF (STU_ID EQ LAST STU_ID) THEN 0 ELSE 1;      
END                                             -*                                               
TABLE FIOE NLCDIST                                                   
SUM   STDCNT                                                      
      COL                                                          
      TRNS_HIGHSCH                                                 
BY    COL NOPRINT                                                  
BY    HIGHEST STDCNT NOPRINT                                       
BY    TRNS_HIGHSCH NOPRINT                                         
ON TABLE HOLD AS NLCDIST1                                          
END                                                                
-RUN                                                               
  

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


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO
 
Posts: 151 | Registered: January 14, 2008Reply With QuoteEdit or Delete MessageReport This Post
Platinum Member
Posted Hide Post
In reference to my first posting, here is a partial display of what I am currently getting:

NLC 0 SAMUEL CLEMENS HIGH
NLC 0 WAGNER HIGH SCHOOL
SAC 100
SAC 1 A BEKA ACADEMY DVD PROGRAM
SAC 1 A C JONES HIGH SCHOO
SAC 1 A CRAWFORD MOSLEY HI
SAC 1 A&M CONSOLIDATED
SAC 38 ACADEMY OF CREATIVE EDUCATION
SAC 1 ACADEMY OF RICHMOND

So, please not the counts are not in sequence. If anyone has an idea, I'd love to see where I am making my mistakes. Thanks....


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO
 
Posts: 151 | Registered: January 14, 2008Reply With QuoteEdit or Delete MessageReport This Post
Virtuoso
Posted Hide Post
You have to put the HIGHEST first in the list. What you have sorts highest within COL.


Ginny
---------------------------------
Prod: WF 7.6.5 with 7.6.6 WFRS; AIX 5.2; WebSphere 6.1.0.15
Dev: WF 7.6.5 with 7.6.6 WFRS; AIX 5.3; WebSphere 6.1.0.15
Primarily self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable
 
Posts: 1524 | Location: BNSF: Fort Worth, TX | Registered: April 05, 2006Reply With QuoteEdit or Delete MessageReport This Post
Platinum Member
Posted Hide Post
Hi, Ginny,

And that's what I want.... highest within COL. In short, I am trying to list, within each college, the highest counts of grads from high schools going to that college:
NLC 10 XYZ HIGH SCHOOL
NLC 9 AVC HIGH SCHOOL
NLC 1 MY SCHOOL
SAC 132 QWE HIGH SCHOOL
SAC 79 THE OLD SCHOOL
SAC 78 THE NEW SCHOOL
SAC 6 THE MIDDLE HIGH SCHOOL
SAC 0 MIDWEST HIGH SCHOOL

To get that type of result, are you saying I should put the HIGHEST code first? Or am I not doing something correctly?

Thanks so much for replying......


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO
 
Posts: 151 | Registered: January 14, 2008Reply With QuoteEdit or Delete MessageReport This Post
Master
Posted Hide Post
Almost right. To calculate (sum) STDCNT within COLLEGE and TRNS_HIGHSCH, and then rearrange acording to the summed value of STDCNT, change the second BY to BY TOTAL.

TABLE FILE NLCDIST
SUM STDCNT
COL
TRNS_HIGHSCH
BY COL NOPRINT
BY TOTAL HIGHEST STDCNT NOPRINT
BY TRNS_HIGHSCH NOPRINT
ON TABLE HOLD AS NLCDIST1
END


- Jack Gross
WF 7.6.7, Win
 
Posts: 529 | Location: NYC | Registered: January 11, 2005Reply With QuoteEdit or Delete MessageReport This Post
Platinum Member
Posted Hide Post
Jack,

THAT WORKED! THANK YOU!

And a big thanks and appreciation to all who offered suggestions and advice. You are a great bunch of people.


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO
 
Posts: 151 | Registered: January 14, 2008Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    HIGHEST function not working for me

Copyright © 1996-2008 Information Builders, leaders in enterprise business intelligence.