Focal Point
Display an Average in Subfooter

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

May 05, 2008, 03:23 PM
ColdWhiteMilk
Display an Average in Subfooter
I'm using 7.6.4

I have a query that I need to display the total number of records in the SUBFOOT, as well as the average of one of the columns in the SUBFOOT.

The total portion works, but the average portion does not.

Any help would be appreciated.

DEFINE FILE SOC_CLR
RECCOUNTER/I8 = 1;
CYCLE_DAYS/I8= IF INVESTIGATION_OPEN EQ '' THEN 0 ELSE DATEDIF(INVEST_OPEN2, INVEST_CLSD2, 'D');
END

TABLE FILE SOC_CLR
PRINT
REQUESTER_LOGIN_NAME_ AS 'Employee ID'
CYCLE_DAYS AS 'Cycle Days'

ON TABLE SUBFOOT
"Total Records = "Average Cycle Time =
WHERE RECORDLIMIT EQ 10;

ON TABLE PCHOLD FORMAT EXL2K
END

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


Production - 7.6.4
Sandbox - 7.6.4
May 05, 2008, 04:08 PM
smiths
Here's a simple example that might help:

DEFINE FILE CAR
MODELCNT/I3 = 1;
END

TABLE FILE CAR
SUM
DEALER_COST
MODELCNT NOPRINT
BY CAR
BY MODEL

ON TABLE SUBTOTAL

ON TABLE RECAP
COST_AVG/D11.2 = DEALER_COST / MODELCNT;

ON TABLE SUBFOOT
"Total Cars: <TOT.MODELCNT"
"Average Dealer Cost: <COST_AVG"

END


Sean


------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
May 05, 2008, 04:46 PM
ColdWhiteMilk
Is there any way to make it work with a TABLE FILE PRINT rather than a TABLE FILE SUM?


Production - 7.6.4
Sandbox - 7.6.4
May 05, 2008, 05:11 PM
Prarie
Try it.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
The error message I get is:

0 ERROR AT OR NEAR LINE 38 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC268) THE FIELD NAME IS NOT REFERENCED IN THE REQUEST STATEMENT: RECCOUNTER
0 ERROR AT OR NEAR LINE 38 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC125) RECAP CALCULATIONS MISSING
(FOC009) INCOMPLETE REQUEST STATEMENT
BYPASSING TO END OF COMMAND


Production - 7.6.4
Sandbox - 7.6.4
Please disregard my last post. I finally noticed that I was missing the MODELCNT NOPRINT
equivavlent line in my code.

Once I did that I got the desired result.

Thank you all for your help.


Production - 7.6.4
Sandbox - 7.6.4
Can this same thing be done by group?

For example:

DEFINE FILE SOC_CLR
RECCOUNTER/I8 = 1;
CYCLE_DAYS/I8= IF INVESTIGATION_OPEN EQ '' THEN 0 ELSE DATEDIF(INVEST_OPEN2, INVEST_CLSD2, 'D');
END

TABLE FILE SOC_CLR
PRINT
REQUESTER_LOGIN_NAME_ AS 'EmployeeID '
REQUESTER_DEPT AS 'Department'
CYCLE_DAYS AS 'Cycle Days'

BY RECCOUNTER NOPRINT

ON REQUESTER_DEPT RECAP
DAYS_AVG/D11.2 = CYCLE_DAYS / RECCOUNTER;

ON REQUESTER_DEPT SUBFOOT
""
"Total Records = "Average Cycle Time (Days)= ""

ON TABLE PCHOLD FORMAT EXL2K
END

I think the problem is with the "RECAP", but I can't figure out what I'm doing wrong.


Production - 7.6.4
Sandbox - 7.6.4
Please change your code so you will see your reccounter. (remoce the noprint)
You will see it is not what you want it to be.

And your RECAP field should also be a BY field.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

Thank you. That worked.

Will WF 7.6.4 let me do a subfooter on a group AND on a table?


Production - 7.6.4
Sandbox - 7.6.4
On a TABLE would not be a subfooter but a report footer.

I would like to suggest some basic training. It will help you a lot.
And search in the documentation for PREFIX values.

You can say

ON COUNTRY SUBFOOT AVE DEALERCOST
ON COUNTRY SUBFOOT MAX DEALERCOST




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

Thank you for your help.

I had very basic training 5-6 years ago, but my background is in MS Access development and Visual Basic, so I am trying to get back up to speed on WebFOCUS (which has changed versions several times since I had my initial training).


Production - 7.6.4
Sandbox - 7.6.4
I'm rather experienced in Access and VB, but with WebFocus we can do much more and much quicker, but I have to convince my IT colleagues every time since the only want .NET




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7