Focal Point
SubTotaling a Define in a SubFoot with Multiple Across

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

April 29, 2008, 05:26 PM
Johnny T
SubTotaling a Define in a SubFoot with Multiple Across
I am having a problem using a DEFINE in a SUBFOOT when more than one ACROSS is used. Take a look at the example report below. When you run it as is, you notice that it properly lists the DEFINE sUBTOTAL in the SUBFOOT. However, if you UnComment the second ACROSS and rerun the report returns a zero for ST.CUSTOM_TOTAL. I am using the DEFINE because I need to grab only certain rows for my custom subtotal. Any advice or suggestions would be appreciated.
>>>>>>>>>>>>>>
 
DEFINE FILE CAR
BLANK/A1 = ' ';
CUSTOM_TOTAL/D33C=IF COUNTRY EQ 'ITALY' AND BODYTYPE EQ 'SEDAN' THEN DEALER_COST ELSE 0;
END
TABLE FILE CAR
SUM
	DEALER_COST
BY BLANK NOPRINT
BY COUNTRY AS ''
BY CAR AS ''
ACROSS BODYTYPE 
-*ACROSS SEATS
ON BLANK SUBFOOT
"Custom Total: <ST.CUSTOM_TOTAL "
END




Production: 7.6.4 WF Server  <=>  7.6.4 WF Client  <=>  7.6.4 Dev Studio
Testing: <none>
Using MRE & BID.  Connected to MS SQL Server 2000
April 30, 2008, 08:46 AM
PBrightwell
This isn't working for you because you haven't SUMMED your CUSTOM_TOTAL field. Try putting CUSTOM_TOTAL NOPRINT after DEALER_COST and make your SUBFOOT on COUNTRY rather than on BLANK.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
April 30, 2008, 09:09 AM
Johnny T
Sorry, I forgot to mention that I need to use the BLANK define in order to have this SubTotal showup at the end of my report, rather than on each Country subgroup. Knowing this do you have any other ideas?



Production: 7.6.4 WF Server  <=>  7.6.4 WF Client  <=>  7.6.4 Dev Studio
Testing: <none>
Using MRE & BID.  Connected to MS SQL Server 2000
April 30, 2008, 10:29 AM
Danny-SRL
Johnny,
This works. But is this what you need?

-* File JohnnyT.fex
DEFINE FILE CAR
BLANK/A1 = ' ';
CUSTOM_TOTAL/D33C=IF COUNTRY EQ 'ITALY' AND BODYTYPE EQ 'SEDAN' THEN DEALER_COST ELSE 0;
END
TABLE FILE CAR
SUM TOT.CUSTOM_TOTAL NOPRINT
SUM
	DEALER_COST
BY BLANK NOPRINT
BY COUNTRY AS ''
BY CAR AS ''
ACROSS BODYTYPE 
ACROSS SEATS
ON BLANK SUBFOOT
"Custom Total: <TOT.CUSTOM_TOTAL "
END



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

April 30, 2008, 10:38 AM
Johnny T
Danny - your example does work and it is what I am looking for. Do you know why you have to use the TOT. instead of ST. in the SubFoot and also, what does the extra SUM verb have to do with the solution? Thank you for your input!



Production: 7.6.4 WF Server  <=>  7.6.4 WF Client  <=>  7.6.4 Dev Studio
Testing: <none>
Using MRE & BID.  Connected to MS SQL Server 2000
April 30, 2008, 10:41 AM
Danny-SRL
Johnny,
The extra SUM forms a multi-set request (you can look it up in the manual: a very powerful feature of WebFocus).
The TOT prefix gives you the report total for the field. That is why I asked whether this is what you need.
BTW, are you coming to the summit? If so, we can meet there.


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

April 30, 2008, 10:50 AM
Johnny T
Thanks for the explanation, I am alrady modifying my report code. I had planned on going to the Summit this year, I've been to the last two, but my wife and I are expecting our next child in early June so I am staying behind this time. Are you coming in all the way from Israel or England to go to Summit? Thanks again for your help!



Production: 7.6.4 WF Server  <=>  7.6.4 WF Client  <=>  7.6.4 Dev Studio
Testing: <none>
Using MRE & BID.  Connected to MS SQL Server 2000
April 30, 2008, 11:01 AM
Danny-SRL
Yes. Coming from Israel. We will have a booth at the Summit showing our product to build self-service applications.


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

April 30, 2008, 11:09 AM
Johnny T
My supervisor will be at Summit, he'll be sure to stop by your booth. Have a safe trip.



Production: 7.6.4 WF Server  <=>  7.6.4 WF Client  <=>  7.6.4 Dev Studio
Testing: <none>
Using MRE & BID.  Connected to MS SQL Server 2000