Focal Point
[SOLVED] Subfoot Total

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

November 14, 2014, 09:52 AM
Raghavendra
[SOLVED] Subfoot Total
Currently we are migrating from WF764 to WF8.0.06, in this process we are encountering couple of issues.

Below is the issue when we are dealing with SUBFOOT totals.

Below is the sample by using CAR file.
TABLE FILE CAR
SUM
DEALER_COST
RETAIL_COST
BY COUNTRY
ON TABLE HOLD AS CAR
END
-RUN

DEFINE FILE CAR
DUMMY / A1 = '';
CV_TOTAL_RND1 / I10 = IF COUNTRY EQ 'ENGLAND' THEN DEALER_COST + RETAIL_COST;
CV_TOTAL_RND2 / I10 = IF COUNTRY EQ 'FRANCE' THEN DEALER_COST + RETAIL_COST;
CV_TOTAL_RND3 / I10 = IF COUNTRY EQ 'ITALY' THEN DEALER_COST + RETAIL_COST;
CV_TOTAL_RND4 / I10 = IF COUNTRY EQ 'JAPAN' THEN DEALER_COST + RETAIL_COST;
CV_TOTAL_RND5 / I10 = IF COUNTRY EQ 'W GERMANY' THEN DEALER_COST + RETAIL_COST;
-*CV_TOTAL_RND6 / I10 = DEALER_COST + RETAIL_COST;
END
-RUN

TABLE FILE CAR
SUM
DEALER_COST
OVER RETAIL_COST
BY DUMMY NOPRINT
ACROSS COUNTRY
ON TABLE ROW-TOTAL AS 'TOT'
ON TABLE SUBFOOT
"<ST.CV_TOTAL_RND1 <ST.CV_TOTAL_RND2 <ST.CV_TOTAL_RND3 <ST.CV_TOTAL_RND4 <ST.CV_TOTAL_RND5"
END
-RUN
-EXIT 


The above code is giving different answers for the SUBFOOT, when I have executed in the WF764 and 8.0.06.

Subfoot Result from WF764 is 83172 10241 92300 11990 119295 where as WF8.0.06 is giving 83172 0 0 0 0.

I would like to have same output in the both versions.

Thanks in Advance.

Regards,
Raghavendra

This message has been edited. Last edited by: <Kathryn Henning>,


Webfocus 7.6.4
Windows, All Outputs
November 14, 2014, 11:01 AM
Wep5622
Please wrap your code sample in code-tags
[code]
[/code]


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
November 14, 2014, 03:55 PM
Y&Y
Hard to tell what causes different results, because the actual SUBFOOT value is missing....
You can try something like that:
TABLE FILE CAR
SUM
	DEALER_COST
	RETAIL_COST
COMPUTE CV_TOTAL_RND/D9 = DEALER_COST + RETAIL_COST ;
BY COUNTRY
ON TABLE HOLD AS TMP1
END
TABLE FILE TMP1
SUM
	DEALER_COST OVER
	RETAIL_COST OVER
	CV_TOTAL_RND AS 'TOTAL'
ACROSS COUNTRY
ON TABLE ROW-TOTAL AS 'TOTAL'
ON TABLE SET PAGE-NUM NOLEAD
END 



WebFOCUS 8204 and older, iWay DataMigrator; Unix/Linux/Windows; Oracle 11g, DB2; SQL, PL/SQL, ETL
November 15, 2014, 04:06 AM
Alan B
The earliest release I have available is 7.6.10. The result from that release to 8.009 is the same, not a particularly useful report though.

Can you explain and show the result differences, and use the code tags please.


Alan.
WF 7.705/8.007
November 19, 2014, 04:31 AM
Raghavendra
quote:
Originally posted by Wep5622:
Please wrap your code sample in code-tags
[code]
[/code]


I have updated your suggestions..


Webfocus 7.6.4
Windows, All Outputs
November 19, 2014, 08:49 AM
Raghavendra
quote:
Originally posted by Alan B:
The earliest release I have available is 7.6.10. The result from that release to 8.009 is the same, not a particularly useful report though.

Can you explain and show the result differences, and use the code tags please.


I have added code tags and also provided output in both versions..
Please have a look at it and give your ideas on this.


Webfocus 7.6.4
Windows, All Outputs
November 19, 2014, 02:36 PM
Alan B
That makes more sense now.

Unfortunately 7.6.10 gives the same result you get in 8.006.

Now I don't remember such a basic change between 7.6.4 and 7.6.10. Anyone else remember anything like this?


Alan.
WF 7.705/8.007
November 19, 2014, 03:27 PM
RSquared
Try something like this.


TABLE FILE CAR
SUM
DEALER_COST
RETAIL_COST
BY COUNTRY
ON TABLE HOLD AS CAR
END
-RUN

DEFINE FILE CAR
DUMMY / A1 = '';
CV_TOTAL_RND / D20 = DEALER_COST + RETAIL_COST;
-*CV_TOTAL_RND6 / I10 = DEALER_COST + RETAIL_COST;
END
-RUN

TABLE FILE CAR

SUM
DEALER_COST
OVER RETAIL_COST
OVER CV_TOTAL_RND AS ' '

BY DUMMY NOPRINT
ACROSS COUNTRY
ON TABLE ROW-TOTAL AS 'TOT'
END
-RUN
-EXIT
\>


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
November 19, 2014, 03:53 PM
Tony A
Can't emphasize Tom's number 1 point enough! Bad practice and one day it will "shoot you in the foot".

I would also change your "ON TABLE SUBFOOT" to "ON DUMMY SUBFOOT" -

SET DROPBLNKLINE = ON
TABLE FILE CAR
SUM
DEALER_COST
RETAIL_COST
BY COUNTRY
ON TABLE HOLD AS TEMPCAR
END
-RUN

DEFINE FILE TEMPCAR
DUMMY / A1 = '';
CV_TOTAL_RND1 / D9 = IF COUNTRY EQ 'ENGLAND'   THEN DEALER_COST + RETAIL_COST;
CV_TOTAL_RND2 / D9 = IF COUNTRY EQ 'FRANCE'    THEN DEALER_COST + RETAIL_COST;
CV_TOTAL_RND3 / D9 = IF COUNTRY EQ 'ITALY'     THEN DEALER_COST + RETAIL_COST;
CV_TOTAL_RND4 / D9 = IF COUNTRY EQ 'JAPAN'     THEN DEALER_COST + RETAIL_COST;
CV_TOTAL_RND5 / D9 = IF COUNTRY EQ 'W GERMANY' THEN DEALER_COST + RETAIL_COST;
END
-RUN

TABLE FILE TEMPCAR
   SUM DEALER_COST
  OVER RETAIL_COST
    BY DUMMY NOPRINT
ACROSS COUNTRY AS ''
ON TABLE ROW-TOTAL AS 'TOT'
ON TABLE SET PAGE NOLEAD
ON DUMMY SUBFOOT
" <ST.CV_TOTAL_RND1<ST.CV_TOTAL_RND2<ST.CV_TOTAL_RND3<ST.CV_TOTAL_RND4<ST.CV_TOTAL_RND5"
ON TABLE SET STYLE *
 headalign=body, $
 type=subfoot, justify=right, $
ENDSTYLE
END
-RUN

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
November 21, 2014, 07:38 AM
Raghavendra
Thanks a lot for the help, we are able to get the same output in both versions.

Thank you very much once again for every one who helped me to get rid out from this.

I think now we can close this ticket.


Webfocus 7.6.4
Windows, All Outputs