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] Average GPA Overall Avg GPA 3 to 4 categories

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Average GPA Overall Avg GPA 3 to 4 categories
 Login/Join
 
Gold member
posted
I'm trying to build a FOCUS report equivalent of what we are currently using form Oracle and MS-Access that will show overall totals by college and Average GPA by college for Applicants, Accepts, Enrolled, etc. So far, I can get either the correct count totals, or the correct Avg GPA but only for Applicants by adding an "AND gpa is not null" to the sql where clause. The totals should count everyone regardless of whether they have a GPA while the GPA should only be calculated if there is a GPA. I tried a few formulas as well as the AVE. option and got same result. I am getting the data via SQL statements as not too familiar with FOCUS yet. Eventually the report will be a drill down. Thanks for your help and ideas.

Here is a sample layout of output (all numbers made up so won't add up GPA wise ):
College   Applied   Accepted  Deposit  ApGPA  AcGPA DepGPA
AA         500      300         120    3.60    3.68  3.70
BB          25       18           5    3.00    3.25  3.26   
*Total     525      318         125    3.50    3.30  3.37
 


Not shown in above counts would be the missing gpa, let's say the missing counts are :
College   Applied   Accepted  Deposit  
AA         100       70          20    
BB          05       08           1     
*Total     105       78          21    
 


Here is the code listing
ENGINE SQLORA SET DEFAULT_CONNECTION ODSP
SQL SQLORA PREPARE SQLOUT FOR
select distinct
        person_uid, academic_period, student_level,  stu_population, college,
               APPLIED,
               ACCEPTED,
               Deposit,
			   GPA
       from population_table a
       where SUBSTR(PROGRAM,1,2) <> 'ND'
	   AND college NOT IN ('00', 'LW')
       AND stu_population   not in ('J', 'S', 'V')
       AND academic_period between '201130' and '201140'
	   AND trunc(date_updated) = trunc(sysdate)
	   
;
END
TABLE FILE SQLOUT
PRINT
     COMPUTE TERMYR/A4 = EDIT(ACADEMIC_PERIOD, '9999$$');
     COMPUTE STU_LEVEL/A2 = IF STUDENT_LEVEL EQ 'GR' OR STUDENT_LEVEL EQ 'DR' THEN 'GR' ELSE STUDENT_LEVEL;
     COMPUTE STU_POP/A1 = IF STU_POPULATION EQ 'G' OR STU_POPULATION EQ 'D' OR STU_POPULATION EQ 'Y' OR STU_POPULATION EQ 'Z' THEN 'G' ELSE STU_POPULATION;
     COLLEGE
     APPLIED
     ACCEPTED
     COMPUTE DEP/D12.2 = DEPOSIT;
	 GPA
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE HOLD AS STATSLOTDETAIL FORMAT FOCUS
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = endeflt,
$
ENDSTYLE
END
DEFINE FILE STATSLOTDETAIL ADD
GPANum/D12.2=ATODBL(GPA, '12', 2);
AvgGPA/D12.2=GPANum / APPLIED;
AvgAcGPA/D12.2=GPANum / ACCEPTED;
END
TABLE FILE STATSLOTDETAIL
SUM
     APPLIED/I5
     ACCEPTED/I5
     DEP/I5 AS 'DEPOSIT'
     GPA
     COMPUTE AplGPA/D12.2 = IF GPANum EQ 0 OR GPANum EQ MISSING THEN 1 / 0 ELSE GPANum / APPLIED;
     AVE.AvgGPA AS 'AVE,AvgGPA'
	 AVE.AvgAcGPA AS 'AVE,AvgAcGPA'
BY  LOWEST TERMYR
BY  HIGHEST STU_LEVEL AS 'STUDENT LEVEL'
BY  LOWEST STU_POP
BY  LOWEST COLLEGE

ON STU_LEVEL RECOMPUTE AS '*TOTAL'

ON STU_POP RECOMPUTE AS '*TOTAL STU_POP'
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SUMMARIZE AvgGPA AS 'TOTAL'
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = endeflt,
$
TYPE=REPORT,
     COLUMN=N4,
     SQUEEZE=0.500000,
$
ENDSTYLE
END

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


WebFocus 7.7.03
Win7, all output
 
Posts: 80 | Registered: January 26, 2011Report This Post
Expert
posted Hide Post
Hi sxschech,

Since you are not too familiar with FOCUS, the choice would be to open a case with Customer Support Services and work through it with support's help. You may either call at 1-800-736-6130, or access online at InfoResponse.

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
 
Posts: 1948 | Location: New York | Registered: November 16, 2004Report This Post
Gold member
posted Hide Post
Hi Kerry,

Thank you for your suggestion to contact Customer Support Services. The technician pointed me to a website, which I think I had seen before, but still could not understand it. But in talking with him, he mentioned something about needing to calculate the counts for each type that I wanted to do the average on in order to exclude the 0's and blanks. After some further experimenting, I think I got it working. What I came up with was creating separate counts and averages and using the IS MISSING like:

COMPUTE APGPACount/I5 = IF GPA IS MISSING THEN 0 ELSE APPLIED;

Here is the revised code text:

ENGINE SQLORA SET DEFAULT_CONNECTION ODSP
SQL SQLORA PREPARE SQLOUT FOR
select distinct
        person_uid, academic_period, student_level,  stu_population, college,
               APPLIED,
               ACCEPTED,
               Deposit,
			   GPA
       from population_table a
       where SUBSTR(PROGRAM,1,2) <> 'ND'
	   AND college NOT IN ('00', 'LW')
       AND stu_population   not in ('J', 'S', 'V')
       AND academic_period between '201130' and '201140'
	   AND trunc(date_updated) = trunc(sysdate)
	   
;
END
TABLE FILE SQLOUT
PRINT
     COMPUTE TERMYR/A4 = EDIT(ACADEMIC_PERIOD, '9999$$');
     COMPUTE STU_LEVEL/A2 = IF STUDENT_LEVEL EQ 'GR' OR STUDENT_LEVEL EQ 'DR' THEN 'GR' ELSE STUDENT_LEVEL;
     COMPUTE STU_POP/A1 = IF STU_POPULATION EQ 'G' OR STU_POPULATION EQ 'D' OR STU_POPULATION EQ 'Y' OR STU_POPULATION EQ 'Z' THEN 'G' ELSE STU_POPULATION;
     COLLEGE
     APPLIED
     ACCEPTED
     COMPUTE DEP/D12.2 = DEPOSIT;
	 GPA
	 COMPUTE APGPACount/I5 = IF GPA IS MISSING THEN 0 ELSE APPLIED;
	 COMPUTE ACGPACount/I5 = IF GPA IS MISSING THEN 0 ELSE ACCEPTED;
	 COMPUTE DEGPACount/I5 = IF GPA IS MISSING THEN 0 ELSE DEP;
	 
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE HOLD AS STATSLOTDETAIL FORMAT FOCUS
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = endeflt,
$
ENDSTYLE
END
DEFINE FILE STATSLOTDETAIL ADD
GPANum/D12.2=ATODBL(GPA, '12', 2);
GPANumAcc/D12.2 = IF ACGPACount = 0 AND ACCEPTED = 0 THEN 0 ELSE GPANum;
GPANumDep/D12.2 = IF DEGPACount = 0 AND DEP = 0 THEN 0 ELSE GPANum;
END
TABLE FILE STATSLOTDETAIL
SUM 
     APPLIED/I5
     ACCEPTED/I5
     DEP/I5 AS 'DEPOSIT'
     COMPUTE AvGPAApplied/D12.2 = GPANum / APGPACount;
     COMPUTE AvGPAAccepted/D12.2 = GPANumAcc / ACGPACount;
     COMPUTE AvGPADeposited/D12.2 = GPANumDep / DEGPACount;
BY  LOWEST TERMYR
BY  HIGHEST STU_LEVEL AS 'STUDENT LEVEL'
BY  LOWEST STU_POP
BY  LOWEST COLLEGE
     
ON STU_LEVEL RECOMPUTE AS '*TOTAL'
     
ON STU_POP RECOMPUTE AS '*TOTAL STU_POP'
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = endeflt,
$
TYPE=REPORT,
     COLUMN=N4,
     SQUEEZE=0.500000,
$
ENDSTYLE
END


WebFocus 7.7.03
Win7, all output
 
Posts: 80 | Registered: January 26, 2011Report This Post
Gold member
posted Hide Post
How do I mark as solved?


WebFocus 7.7.03
Win7, all output
 
Posts: 80 | Registered: January 26, 2011Report This Post
Expert
posted Hide Post
Hi sxschech,

Thank you very much for confirmation. To update the subject line, you can go back to the very first post, click on the yellow "folder and pencil" icon underneath the message, edit the subject line in the new window, and click on Post after done with editing.

Hope this helps. Or if preferred, please let me know and I will do the updating over here.

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
 
Posts: 1948 | Location: New York | Registered: November 16, 2004Report This Post
Gold member
posted Hide Post
Hi Kerry,

Thanks for the instructions on editing the message header.


WebFocus 7.7.03
Win7, all output
 
Posts: 80 | Registered: January 26, 2011Report 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] Average GPA Overall Avg GPA 3 to 4 categories

Copyright © 1996-2020 Information Builders