Focal Point
[CLOSED] COMPUTE after BY?

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

January 28, 2011, 10:26 AM
Cody
[CLOSED] COMPUTE after BY?
Hi All,
Hopefully I can explain what I am trying well.

I have a report that is doing Totals and allows the user to sort the report manually. I am also doing alternate row styling using css. My problem is that when a user changes the sort, some of the BY rows are showing up more than once. When I change the BY to use TOTAL my alternating lines are breaking.

My actual data source and columns are different, but I think this represents what I am trying to do.
  
TABLE FILE SALES
SUM
	SALES
	REVENUE
	PROFIT
	COMPUTE PCT_SALES/D3% = (SALES/TOTAL_SALES)*100;
	COMPUTE BAND1/I1= IF LAST BAND1 EQ 1 THEN 2 ELSE 1; NOPRINT
BY &ORDER TOTAL &SORT NOPRINT
BY REGION_NAME	
ON TABLE RECOMPUTE SALES REVENUE PROFIT PCT_SALES
ON TABLE HOLD AS ONSST FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON

TYPE=TITLE, COLUMN=N3, FOCEXEC=app/on_subjstat_container( SORT='SALES' ), CLASS=reportTitle, $
TYPE=TITLE, COLUMN=N3, FOCEXEC=app/on_subjstat_container( SORT='REVENUE' ), CLASS=reportTitle, $
TYPE=DATA, CLASS=reportDataEven, WHEN=BAND2 NE 1, $
TYPE=DATA, CLASS=reportDataOdd, $


Any help would be great.

Cody

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


WebFOCUS 7.6.8
Linux
HTML,AHTML,PDF
January 29, 2011, 01:20 PM
<FreSte>
Cody,

In the table request you are computing BAND1 and in the stylesheet you are using field BAND2 ?

... but maybe you could use the following code in the stylesheet for alternating backcolors

  
TYPE=DATA     ,BACKCOLOR=(RGB(255 255 255) RGB(245 245 245)),$


-Fred-
February 04, 2011, 09:57 AM
Cody
Hi Fred,

The BAND1/BAND2 is just a type, they are both the same in my code. I had to resort to the code you have below, but it blew up a lot of my css styling, so I had to recreate all that as well


WebFOCUS 7.6.8
Linux
HTML,AHTML,PDF