Focal Point
[SOLVED]using PRINT with OVER and SUM

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

December 13, 2016, 07:40 AM
Ramya
[SOLVED]using PRINT with OVER and SUM
Hi All,

I have used a OVER and ACROSS in the code.. I need to PRINT one more field which I am unable to do. My current code, output and expected output I have given below.

 
TABLE FILE xxx
SUM
METRIC1 AS Number_of_Homes_Passed
OVER
METRIC2 AS Number_of_Subscribers
BY FRANCHISE_NAME NOPRINT
ACROSS MONTH_SORT NOPRINT
ACROSS ONEMONTHBACK AS ''
ON TABLE SUBHEAD
" "
ON TABLE SET PAGE NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT &disp
-*ON TABLE SET WEBVIEWER ON
ON TABLE SET WEBVIEWTARG OFF
-*ON TABLE SET CACHELINES 100
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=OFF,
     ORIENTATION=PORTRAIT,
	 JUSTIFY=CENTER,
	 LEFTMARGIN=0.500000,
     RIGHTMARGIN=0.500000,



My output looks like the following

   

                          Sep-16   Oct-16    Nov-16
Number_of_Homes_Passed     1303     1303      1296 
Number_of_Subscribers       63       68       464 


Now I need to include one more field called rolling3 here as the average of rolling 3 months which I am unable to do.. shown the required output below.I am confused on how to attain this result.

               Rollin3  Sep-16   Oct-16    Nov-16
Home_passed     1300     1303     1303      1296 
Subscribers     198       63       68       464 


Thanks,
Ramya
WebFOCUS 8105, HTML, Javcascript

This message has been edited. Last edited by: <Emily McAllister>,
December 13, 2016, 08:52 AM
MartinY
hi Ramya,

When trying to display sample as you do, you can also use the code tag, you will then be able to have your "data" properly aligned which makes the reading easier.

What I do suggest it first try to accomplish your need WITHOUT the OVER command. Once you'll have all your data in a "regular" format it will become much more easy to then add the OVER.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
December 13, 2016, 08:58 AM
Ramya
Hi Martin,

Thanks for the input. I have included the code tag for the sample output and it looks good now.

I will try the way you have suggested and will let you know..

Thanks once again

Ramya
WebFOCUS 8105, HTML, Javcascript
December 13, 2016, 12:51 PM
Danny-SRL
Ramya,
Here is a solution using the CAR file:
  
-* File Ramya.fex

TABLE FILE CAR
SUM
   RETAIL
   DEALER
BY SEATS
ON TABLE HOLD
END
-*
FILEDEF HOLD DISK HOLD.FTM (APPEND
-*
DEFINE FILE HOLD
SEAT0/I3=0;
END
TABLE FILE HOLD
SUM
AVE.RETAIL
AVE.DEALER
BY SEAT0
ON TABLE SAVB AS HOLD
END
-*
DEFINE FILE  HOLD
ONEMONTH/A12=DECODE SEATS(0 'Rollin3' 2 'Sep-16'  4 'Oct-16'   5 'Nov-16');
END
TABLE FILE HOLD
SUM
   RETAIL AS Homes_Passed
   OVER
   DEALER AS Subscribers
ACROSS SEATS NOPRINT
ACROSS ONEMONTH AS ''
END

This message has been edited. Last edited by: Danny-SRL,


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

December 14, 2016, 08:05 AM
Ramya
Daniel,

That's the great idea, which I have never thought of. That seems perfect. I will use the same logic in my piece of code to accomplish my requirement.

Thanks so much,
Ramya
WebFOCUS 8105, HTML, Javascript