[CLOSED] Referencing a Field Value in an ACROSS-TOTAL Label
Does anyone know if you can reference a field name in an ACROSS-TOTAL Label?
In the following code there are multiple ACROSS-TOTALS for each instance of the first ACROSS field. Instead of all of the ACROSS-TOTALS having a label of "CAR Total", I would like "England Total", "France Total"....
Any help would be greatly appriciated. Thanks!
TABLE FILE CAR SUM DEALER_COST BY BODYTYPE ACROSS COUNTRY ACROSS CAR AS '' ACROSS-TOTAL AS 'CAR Total' ENDThis message has been edited. Last edited by: Kerry,
WF 7.6.6, Win 2K3 SP2
January 12, 2010, 04:31 PM
eb
I don't know if there's a simpler way but here's a potential solution. Its rather long, but essentially you save each total, combine crunch the hold files into one, then merge it into your original data set.
..Only done for Italy and England. Also The "Z_" would ensure that the total appears at the end of the columns (you can be creative and change it to something else)
-* Gather "title" info
TABLE FILE CAR
SUM DEALER_COST
COMPUTE TITLE/A20 = 'Z_ENGLAND TOTAL';
BY COUNTRY
BY BODYTYPE
WHERE COUNTRY EQ 'ENGLAND'
ON TABLE HOLD AS ONE
END
TABLE FILE CAR
SUM DEALER_COST
COMPUTE TITLE/A20 = 'Z_ITALY TOTAL';
BY COUNTRY
BY BODYTYPE
WHERE COUNTRY EQ 'ITALY'
ON TABLE HOLD AS TWO
END
TABLE FILE ONE
SUM DEALER_COST
BY COUNTRY
BY TITLE
BY BODYTYPE
ON TABLE HOLD AS THREE
MORE
FILE TWO
END
-* Data set to be merged
DEFINE FILE CAR
CAR_NAME/A20 = CAR;
END
TABLE FILE CAR
SUM DEALER_COST
BY COUNTRY
BY CAR_NAME AS 'TITLE'
BY BODYTYPE
WHERE COUNTRY EQ 'ENGLAND' OR 'ITALY'
ON TABLE HOLD AS CARS
END
TABLE FILE CARS
SUM DEALER_COST
ACROSS COUNTRY
ACROSS TITLE
BY BODYTYPE
MORE
FILE THREE
END
Erfan WF 7.6.9. Dev Studio/BID/Info Assist/Report Caster/MRE
I hear you, Matt. I wish WF allows column headings, across heading to have embedded fields just like the subhead/subfoot...
If it is only for cosmatic reason, you can start from here...
TABLE FILE CAR
SUM
SALES
BY BODYTYPE
ACROSS COUNTRY AS ''
ACROSS CAR AS '' ACROSS-TOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
$
TYPE=ACROSSVALUE,
ACROSS=1,
JUSTIFY=RIGHT,
$
TYPE=ACROSSVALUE,
ACROSS=2,
JUSTIFY=RIGHT,
$
TYPE=ACROSSTITLE,
ACROSS=1,
JUSTIFY=RIGHT,
$
TYPE=ACROSSTITLE,
ACROSS=2,
JUSTIFY=RIGHT,
$
ENDSTYLE
END