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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
percentages
 Login/Join
 
Member
posted
I am writing a report with using the pct.cnt
My code is:
TABLE FILE APPLICANTS
SUM CNT.PIDM_KEY AS ''
PCT.CNT.PIDM_KEY AS ''
AND ROW-TOTAL AS ''
AND COLUMN-TOTAL
BY MATHTXT AS ''
ACROSS STATE AS ''

My output is something like this (I hope you can pick out my columns, when I post this the nice formatting will be lost)
A B TOTAL
Group A 931 97.69 443 89.13 1374 186.83
Group B 22 2.31 54 10.87 76 13.17
TOTAL 954 100.00 497 100.00 1450 200.00

If you notice the % are correct for column A & B but for my total column is adding the row percentages. I want my total column % to be 1374/1450 & 76/1450.

Any suggestions??

Thanks!!
 
Posts: 26 | Registered: February 25, 2005Report This Post
Gold member
posted Hide Post
Well I've tackled this problem and came up with the following solution... a tad tedious but does the trick.

I didn't use the Row total and just calculated it instead.


DEFINE FILE APPLICANTS
-* This is assuming that the field "STATE" IS "A7"
-* creating a dummy "STATE" variable called ROWTOTAL
ACROSSFIELD/A7 = 'ROWTOTAL';
END
-*
TABLE FILE APPLICANTS
SUM CNT.PIDM_KEY AS 'CNTPIDM_KEY'
BY MATHTXT BY ACROSSFIELD
ON TABLE HOLD AS TEMP1 FORMAT FOCUS
END
-*
USE CLEAR
-*
TABLE FILE APPLICANTS
SUM CNT.PIDM_KEY AS 'CNTPIDM_KEY'
BY MATHTXT BY STATE AS 'ACROSSFIELD'
ON TABLE HOLD FORMAT ALPHA
END
-*
MODIFY FILE TEMP1
FIXFORM FROM HOLD
MATCH MATHTXT ACROSSFIELD
ON NOMATCH INCLUDE
ON MATCH GOTO TOP
DATA ON HOLD
END
-*
DEFINE FILE TEMP1
-* Used to get double precision for the Percentage
CNTP/D12.2 = CNTPIDM_KEY;
END
-*
TABLE FILE TEMP1
SUM CNTPIDM_KEY AS '' PCT.CNTP AS ''
COLUMN-TOTALS AS ''
BY MATHTXT AS ''
ACROSS ACROSSFIELD AS ''
END

Added "-*" to space things out.. not sure why it bunched it all together.
That was my super elegant Roll Eyes solution

Leo

This message has been edited. Last edited by: <Mabel>,
 
Posts: 96 | Location: Winnipeg, Manitoba, Canada | Registered: January 22, 2004Report This Post
Guru
posted Hide Post
OK. I think this simulates your issue:


What you currently have ...

JOIN CLEAR *
JOIN PIN IN EMPDATA TO ALL PIN IN TRAINING AS J1
-*
TABLE FILE EMPDATA
SUM CNT.COURSECODE AS ''
PCT.CNT.COURSECODE AS ''
AND ROW-TOTAL AS ''
AND COLUMN-TOTAL
BY DEPT AS ''
ACROSS DIV AS ''
WHERE DIV EQ 'SE' OR 'NE'
END


What you need ....


JOIN CLEAR *
JOIN PIN IN EMPDATA TO ALL PIN IN TRAINING AS J1
-*
TABLE FILE EMPDATA
SUM
CNT.COURSECODE NOPRINT
SUM CNT.COURSECODE AS ''
PCT.CNT.COURSECODE AS ''
-*AND ROW-TOTAL AS ''
BY DEPT AS ''
ACROSS DIV AS ''
COMPUTE
CNT_CRS/I6 = C2 + C4; AS 'Total'
COMPUTE
PCT_CNT_CRS/F6.2 = CNT_CRS/C1 * 100; AS ''

-*
ON TABLE COLUMN-TOTAL
-*
WHERE DIV EQ 'SE' OR 'NE'
END


A little multi-verb request and COMPUTEs using
column notation ... be sure to place it after
the ACROSS.
 
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders