November 29, 2011, 10:20 AM
10HAKENReport Variable and Computes
Looking for a way to be able to compute the gross profit on the fly based on the output BY fields selected but want the computed field to be one of the &Sum Variable output field choices. Can not find a way to add a computed field as a report variable where more than one field choice is selected for the variable sum fields. For the below COMPUTE SALE_COST_PERC, I want it to be part of the &Sum variable. Tried adding it to the metadata as a compute but still won't allow it to be selected. Forced it to "work" by adding COMPUTE SALE_COST_PERC field in the &Sum line which broke the fex but with defaults could get it to select in HTML but it only works when one &Sum field is selected but breaks when multiple fields from the &Sum choices are selected.
TABLE FILE CAR
SUM
&Sum.(AND(
,,)).Sum Fields.
COMPUTE SALE_COST_PERC/D12.2% = IF CAR.BODY.SALES EQ 0 THEN 0 ELSE IF CAR.BODY.RETAIL_COST EQ 0 THEN 0 ELSE ( ( ( CAR.BODY.SALES - CAR.BODY.RETAIL_COST ) / CAR.BODY.SALES ) * 100 ); AS 'Sales Cost %'
BY LOWEST &Measure.(BY(,,,)).Measure.
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SUMMARIZE AS 'TOTAL'
November 29, 2011, 11:29 AM
Dougust a thought as I'm not really sure what you really want: Try putting the fields which you'd like to SUM in a HOLD file (pre-processed) and JOIN to that so that you can use the fields from the HOLD file...
November 29, 2011, 11:52 AM
10HAKENHow would you produce the field list for them to select from and then reference that?
I want the compute field to be one of their options to have as an output or not.
For Example:
They can select one or all or combination of sum fields
Revenue
Invoice Cost
Gross Profit
Gross Profit %
As well as they can choose what BY fields they want- one or all or combination
Country
Region
City
How are you able to get the compute Gross Profit % in that selection criteria (i.e. report variable)?