Focal Point
Calculating Percentage on Total

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1171074351

February 10, 2006, 01:04 AM
Sridevi
Calculating Percentage on Total
When I code

TABLE FILE CAR
SUM SEATS BY COUNTRY SUBTOTAL BY CAR ACROSS MODEL
ON TABLE ROW-TOTAL
END

I get the following output

Model

100LSDOOR ………… V12XKE XJ12L TOTAL
Country Car

England Jaguar . ……… 2 5 7
Jensen . …… 4 . . 4
Triumph . …… . 2 . . 2
________________________________________________________________________________
Total England 4 2 2 5 13
________________________________________________________________________________

Italy Alpha Romeo . … 4 2 2 8
Maserati . ……… 2 2
______________________________________________________________________________________
Total Italy 4 2 2 2 10
______________________________________________________________________________________


But I need the subtotal only on Total Column. I want only 13 and 10 to be displayed across country .Also how do we calculate percentage on this Total column?

The expected report output is something like this


Model

100LSDOOR ………… V12XKE XJ12L TOTAL PERCENTAGE
Country Car

England Jaguar . ……… 2 5 7
Jensen . …… 4 . . 4
Triumph . …… . 2 . . 2
_________________________________________________________________________________________
Total England 13 56.53
_________________________________________________________________________________________

Italy Alpha Romeo . … 4 2 2 8
Maserati . ……… 2 2
__________________________________________________________________________________________
Total Italy 10 43.47
__________________________________________________________________________________________


I am not sure if this is possible. Please let me know the feasibility.


Thanks & Regards,
Sridevi
Webfocus 7.6.5 | Windows |
HTML
February 10, 2006, 01:12 AM
Sridevi
Oh!!

The output format is not clear..
you can better understand once u run the code with car


Thanks & Regards,
Sridevi
Webfocus 7.6.5 | Windows |
HTML
February 10, 2006, 02:38 AM
Pete
Hi Sridevi

does this help?

TABLE FILE CAR
SUM SEATS BY COUNTRY BY CAR ACROSS MODEL
ON COUNTRY SUBTOTAL
ON TABLE ROW-TOTAL
END


Greetings,

P.


D: WF 7.6.2 P. : WF 7.6.2 on W2003
------------------------------------------------------------------
I see myself as an intelligent, sensitive human, with the soul of a clown which forces me to blow it at the most important moments.

-Jim Morrison-

February 10, 2006, 06:10 AM
Sridevi
No Pete..

Its the same as my code. No difference.
If you see the output the subtotal give the total on all the columns but i require it only on the Totals not on all the columns....i.e in our example the total should only be on the Total column that we get from ROW-TOTAL and not on other Model columns.

Hope you get me.


Thanks & Regards,
Sridevi
Webfocus 7.6.5 | Windows |
HTML
February 10, 2006, 09:13 AM
Prarie
Try
ON TABLE COLUMN-TOTAL WHATEVER

put the specific columns you want totaled and it will only total them.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
See what you think of this. You can use across model or by model depending on which you like better.

DEFINE FILE CAR
P_SEATS/D6.2S = SEATS;
END
-*
TABLE FILE CAR
SUM
SEATS
PCT.P_SEATS AS 'PCT.'
BY COUNTRY
SUM
SEATS
BY COUNTRY
BY CAR
BY MODEL
-*ACROSS MODEL
ON COUNTRY SUBFOOT
" "
ON TABLE COLUMN-TOTALS SEATS PCT.P_SEATS
END

Jim


WF DevStu 5.2.6/WF Srv 5.2.4/Win NT 5.2
Try this.

DEFINE FILE CAR
SEATSF5/F5.2%=SEATS;
END

TABLE FILE CAR
SUM SEATS NOPRINT PCT.SEATSF5 NOPRINT
BY COUNTRY
SUM SEATS
BY COUNTRY SUBFOOT
" "
"Total <COUNTRY<+0>: <SEATS == <PCT.SEATSF5</1"
BY CAR
ACROSS MODEL
ON TABLE ROW-TOTAL
ON TABLE SET STYLE *
TYPE=SUBFOOT, STYLE=BOLD, COLOR=RED,$
ENDSTYLE
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
Thanks a lot for all your replies

Thanks Jim and Mickey
Grt!!!

The code worked out. Smiler


Thanks & Regards,
Sridevi
Webfocus 7.6.5 | Windows |
HTML
Is it possible to print a BY column after ACROSS
column.

when we code

TABLE FILE CAR
SUM SEATS
BY CAR
ACROSS MODEL
BY COUNTRY
END

we get COUNTRY printed before MODEL
Is it possible to print COUNTRY after MODEL having MODEL in ACROSS?


Thanks & Regards,
Sridevi
Webfocus 7.6.5 | Windows |
HTML
Sridevi,

YES, I think it is possible to do this. I will do some experimenting when I get a chance to get an example together. I know there are stylesheet commands that allow you to move columns around on the report but do not know the keywords off hand. check the manual for column positioning in the stylesheet section.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
Sridevi,

Try this:

TABLE FILE CAR
SUM SEATS
BY CAR
ACROSS MODEL
BY COUNTRY
ON TABLE SET STYLE *
TYPE=REPORT, COLUMN=COUNTRY, SEQUENCE=999,$
ENDSTYLE
END

The only problem with using the SEQUENCE option is that you need to know how many ACROSS columns you have so that you can position the COUNTRY column appropriately. However, setting SEQUENCE to a very high number seems to be OK so you don't need to be so exact.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
Hi,

For information on column positioning, try the Creating Reports With WebFOCUS Language manual.

Version 7.1: DN4500695.0905
Version 5.3: DN4500580.0904

Hope this helps.

-Jenn
Thanks Mickey

The Sequence option worked out.


Thanks & Regards,
Sridevi
Webfocus 7.6.5 | Windows |
HTML