October 15, 2004, 08:20 AM
<Kalyan>percentage on column totals
Hi,
I have a report which shows data AS BELOW.
eg:
name total amt1 amt2
----------------------------------
xx 1000 250 750
ww 1500 500 1000
qq 750 600 150
----------------------------------
TOTAL 3250 1350 1900
41.5% 58.5%
For the column total values I have used ON TABLE COLUMN-TOTAL. Now I need to display the percentage values correctly aligned .
any suggestions??
Thanks,
Kalyan.
October 15, 2004, 01:29 PM
susannahKaylan, how does your fex calculate and place those %s? Can we see a code snip?
October 15, 2004, 05:41 PM
StanCan you use 'IN 20' or if it is in a subfoot '<20' to line them up on the 20th column? Just curious to know if this will work?
stan
October 16, 2004, 12:52 AM
<WFUser>If you're calculating the percentage, just use SUMMARIZE instead of COLUMN-TOTAL. If these values are database fields in a PRINT statement, use a mutli-verb request with RECAP. Try this.
TABLE FILE CAR
SUM RCOST NOPRINT DCOST NOPRINT
CNT.RCOST NOPRINT
PRINT RCOST DCOST
BY COUNTRY
ON TABLE RECAP RCOST_AVG/D8.2 = (C1/C3);
DCOST_AVG/D8.2 = (C2/C3);
ON TABLE SUBFOOT
" Average RCOST: <RCOST_AVG DCOST: <DCOST_AVG"
END
October 16, 2004, 09:50 AM
<Kalyan>What I am trying to do is this
TABLE FILE CAR
SUM RETAIL_COST DEALER_COST
BY COUNTRY
ON TABLE SUMMARIZE
-*( we can use ON TABLE COLUMN-TOTAL as well)
END
This will give me the following output
COUNTRY RETAIL_COST DEALER COST
---------- ------------ -------------
ENGLAND 45,319 37,853
FRANCE 5,610 4,631
ITALY 51,065 41,235
JAPAN 6,478 5,512
W GERMANY 64,732 54,563
----------------------------------------
TOTAL 173,204 143,794
83.02% I need to calculate the percentage value( 83.02 = (143,794/173,204) *100 ) and place it under the column dealer cost.
I am not sure of a way to refer to the summary values as such.
Thanks.
October 16, 2004, 01:46 PM
<kj>Kalyan,
Have you tried with
ON TABLE SUBFOOT
Thanks,
kj
October 16, 2004, 03:27 PM
LeahIf you use the internal column notation the first colum summed is C1 the second is C2
then you can
On table recap
pctval/d6.2 = ( C2 / C1 ) * 100;
subfoot
"<xx>pctval '%'"
doin this from memory so check the syntax for sure.
October 19, 2004, 01:32 PM
<Kalyan>Thanks for your posts, I was able to get the percentage values. I used ON TABLE COLUMN-TOTAL & then Using RECAP on cloumns & Printing the values in the SUBFOOT.
Now the problem is I'm not able to align the percentage values with the respective columns.
i tried the following way...
-------------------------------------------
ON TABLE SUBFOOT
"<VAL1><+0><VAL2><0+><VAL3>"
ON TABLE SET STYLESHEET *
TYPE =SUBFOOT,
OBJECT=FIELD,
ITEM=1,
STYLE=ITALIC,
POSITION=N3,
$
TYPE =SUBFOOT,
OBJECT=FIELD,
ITEM=2,
STYLE=ITALIC,
POSITION=N4,
$
TYPE =SUBFOOT,
OBJECT=FIELD,
ITEM=3,
STYLE=ITALIC,
POSITION=N5,
$
-------------------------------------------------
I just get the three values printed on leftside corner & not aligned to the columns as mentioned in stylesheet.
Help!!!