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] Calculate Percent of Grand Total

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Calculate Percent of Grand Total
 Login/Join
 
Platinum Member
posted
I have a three column report:

Field 1 is the Plan Code (the group by field)

Field 2 is the number of employees in that plan code

Field 3 is the Percent of the TOTAL population that is in that specific plan code.

I saw this thread, but can not get it to apply to my report:

Calculating percentages off a subtotal line

Could some please point me in the right direction for any documentation on this?

My Code:

JOIN CLEAR *

JOIN
ACTIVEPOP.EMP_SSN
IN ACTIVEPOP TO ALL CEESTATUS.EMP_SSN
IN CEESTATUS
AS J1
END

TABLE FILE ACTIVEPOP
PRINT
ACTIVEPOP.PRD_DATE AS 'PRD_DATE'
ACTIVEPOP.EMP_SSN AS 'EMP_SSN'
ACTIVEPOP.PENSION_PLAN_NBR AS 'PENSION_PLAN_NBR'
ACTIVEPOP.EMPLOYEE_STATUS_CODE AS 'EMPLOYEE_STATUS_CODE'
ACTIVEPOP.BATCH_TERM_PROCESS_PENDING_IND AS 'BATCH_TERM_PROCESS_PENDING_IND'
ACTIVEPOP.PAYMENT_FREQUENCY AS 'PAYMENT_FREQUENCY'
ACTIVEPOP.BENEFIT_PAYMENT_OPTION AS 'BENEFIT_PAYMENT_OPTION'
CEESTATUS.ELIGIBILITY_STATUS_CODE AS 'ELIGIBILITY_STATUS_CODE'
CEESTATUS.GI_EMPLOYEE_STATUS_CODE AS 'GI_EMPLOYEE_STATUS_CODE'

ON TABLE HOLD AS ACTIVEPOP2
END

DEFINE FILE ACTIVEPOP2
CNTR/I8= WITH PRD_DATE = 1;
END

TABLE FILE ACTIVEPOP2
SUM
	TOT.ACTIVEPOP2.EMP_SSN
	ACTIVEPOP2.PENSION_PLAN_NBR AS 'Plan Code'
	CNT.ACTIVEPOP2.EMP_SSN AS '# of Emps'
	CNTR
COMPUTE PERCENT/D6.2% = (C3/(C1/C4))*100;
BY PRD_DATE RECOMPUTE
BY ACTIVEPOP2
END

BY ACTIVEPOP2.PENSION_PLAN_NBR NOPRINT

WHERE ACTIVEPOP2.ELIGIBILITY_STATUS_CODE NE 'D'
WHERE ACTIVEPOP2.GI_EMPLOYEE_STATUS_CODE NE 'D'

ON TABLE PCHOLD FORMAT EXL2K
END

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


Production - 7.6.4
Sandbox - 7.6.4
 
Posts: 241 | Location: Bethesda, MD | Registered: August 14, 2007Report This Post
Expert
posted Hide Post
Perhaps using WITHIN in a PCT calculation will do what you require.

Try searching for PCT WITHIN in this forum.


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
TABLE FILE ACTIVEPOP2
SUM
ACTIVEPOP2.PENSION_PLAN_NBR AS 'Plan Code'
CNT.ACTIVEPOP2.EMP_SSN AS '# of Emps'
PCT.EMP_SSN/D6% WITHIN ACTIVEPOP2 AS 'Pct%'

BY ACTIVEPOP2.PENSION_PLAN_NBR NOPRINT

ON TABLE RECOMPUTE



Gives me:


(FOC282) RESULT OF EXPRESSION IS NOT COMPATIBLE WITH THE FORMAT OF FIELD: EMP_SSN


Production - 7.6.4
Sandbox - 7.6.4
 
Posts: 241 | Location: Bethesda, MD | Registered: August 14, 2007Report This Post
Expert
posted Hide Post
How about PCT.CNT.
TABLE FILE EMPLOYEE
SUM CNT.EMP_ID
PCT.CNT.EMP_ID
BY DEPARTMENT
END


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Platinum Member
posted Hide Post
That worked! Thank you GinnyJakes!

My code:
JOIN CLEAR *

JOIN
ACTIVEPOP.EMP_SSN
IN ACTIVEPOP TO ALL CEESTATUS.EMP_SSN
IN CEESTATUS
AS J1
END

TABLE FILE ACTIVEPOP
PRINT
ACTIVEPOP.PRD_DATE AS 'PRD_DATE'
ACTIVEPOP.EMP_SSN AS 'EMP_SSN'
ACTIVEPOP.PENSION_PLAN_NBR AS 'PENSION_PLAN_NBR'
ACTIVEPOP.EMPLOYEE_STATUS_CODE AS 'EMPLOYEE_STATUS_CODE'
ACTIVEPOP.BATCH_TERM_PROCESS_PENDING_IND AS 'BATCH_TERM_PROCESS_PENDING_IND'
ACTIVEPOP.PAYMENT_FREQUENCY AS 'PAYMENT_FREQUENCY'
ACTIVEPOP.BENEFIT_PAYMENT_OPTION AS 'BENEFIT_PAYMENT_OPTION'
CEESTATUS.ELIGIBILITY_STATUS_CODE AS 'ELIGIBILITY_STATUS_CODE'
CEESTATUS.GI_EMPLOYEE_STATUS_CODE AS 'GI_EMPLOYEE_STATUS_CODE'

WHERE CEESTATUS.ELIGIBILITY_STATUS_CODE NE 'D'
WHERE CEESTATUS.GI_EMPLOYEE_STATUS_CODE NE 'D'

ON TABLE HOLD AS ACTIVEPOP2
END

-*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-* Final - Active Population - Summary
-*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
TABLE FILE ACTIVEPOP2
SUM
ACTIVEPOP2.PENSION_PLAN_NBR AS 'Plan Code'
CNT.ACTIVEPOP2.EMP_SSN AS '# of Emps'
PCT.CNT.ACTIVEPOP2.EMP_SSN AS '# of Total'

BY ACTIVEPOP2.PENSION_PLAN_NBR NOPRINT

ON TABLE PCHOLD FORMAT EXL2K
END

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
Platinum Member
posted Hide Post
In the line:

PCT.CNT.ACTIVEPOP2.EMP_SSN AS '# of Total'


The result displays as "21.00". Would I use the stylesheet to make that display as "21.00%"?


Production - 7.6.4
Sandbox - 7.6.4
 
Posts: 241 | Location: Bethesda, MD | Registered: August 14, 2007Report This Post
Expert
posted Hide Post
Put a slash after the EMP_SSN with the format that you want: EMP_SSN/D6.2%.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Guru
posted Hide Post
Just change the number format.

TABLE FILE CAR
SUM
CNT.MODEL AS 'Model Count'
PCT.CNT.MODEL/F6.2% AS 'Percentage'
BY COUNTRY
ON TABLE SUBTOTAL
END


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report This Post
Platinum Member
posted Hide Post
Very cool!

Thank you both.


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] Calculate Percent of Grand Total

Copyright © 1996-2020 Information Builders