[CLOSED]is there a problem using RECAP in an ACROSS report?
I have a report using ACROSS commands and I would like to RECAP some values based on the ACROSS values and show them in a subfoot. I get an errorFOC268) THE FIELD NAME IS NOT REFERENCED IN THE REQUEST STATEMENT: TIMESORT
Ex: TABLE FILE x SUM SALES AS 'Sales' CREDIT NOPRINT BY DIVISION AS ' ' ACROSS TIMESORT AS ' ' ON DIVISION RECAP CRD1/D18 = IF TIMESORT EQ 'D' THEN CREDIT ELSE 0; CRD2/D18 = IF TIMESORT EQ 'M' THEN CREDIT ELSE 0; CRD3/D18 = IF TIMESORT EQ 'Q' THEN CREDIT ELSE 0;
ON DIVISION SUBFOOT "Credits: Is there a reason why it's not working?
Thanks.This message has been edited. Last edited by: <Emily McAllister>,
January 24, 2005, 05:08 PM
FliPPeR
If I do my RECAP based on a COMPUTED value, I only get something for the first ACROSS value!?
EX: TABLE FILE x SUM SALES AS 'Sales' COMPUTE CREDIT/D18 = IF TIMESORT NE 'Z' THEN CREDIT_VALUE ELSE 0; NOPRINT BY DIVISION AS ' ' ACROSS TIMESORT AS ' ' ON DIVISION RECAP CRD1/D18 = IF TIMESORT EQ 'D' THEN CREDIT ELSE 0; CRD2/D18 = IF TIMESORT EQ 'M' THEN CREDIT ELSE 0; CRD3/D18 = IF TIMESORT EQ 'Q' THEN CREDIT ELSE 0;
ON DIVISION SUBFOOT "Credits: <CRD1 <CRD2 <CRD3"
CRD1 has a value, others are 0 but souldn't.
HELP!
January 25, 2005, 05:05 AM
Piipster
Try doing a COMPUTE fldnm NOPRINT instead of a RECAP. Then do a subfoot to display the calculation.
Use the search utility to search for 'COMPUTE AFTER' to find other topics that show this technique.
I tried the COMPUTE with column notation after the ACROSS commands and it's giving me strange results... My last ACROSS value column is empty and the results of my COMPUTED fields in the Subfoot are wrong.
I don't know what to do. I've searched and tried a lot.
Why is it so difficult to have a subfoot showing totals of an hidden column (noprint) for each ACROSS value??
December 29, 2015, 05:18 AM
Ricardo Augusto
Piipster,
How can I do a subfoot on ACROSS ?
Thanks
WebFOCUS 8.1.05 / APP Studio
January 05, 2016, 02:53 PM
Edward Wolfgram
Wow, Ricardo, you've dug up an old one- they left these guys in the lurch 10 years ago.
This is what I think they wanted:
TABLE FILE CAR
SUM DCOST SALES
ACROSS SEATS
BY COUNTRY SUB-TOTAL
IF SEATS FROM 2 TO 5
END
-RUN
SEATS
2 4 5
COUNTRY DEALER_COST SALES DEALER_COST SALES DEALER_COST SALES
------------------------------------------------------------------------
ENGLAND 11,719 0 14,940 0 11,194 12000
*TOTAL ENGLAND
11,719 0 14,940 0 11,194 12000
FRANCE . . . . 4,631 0
*TOTAL FRANCE
0 0 0 0 4,631 0
ITALY 36,320 25400 4,915 4800 . .
*TOTAL ITALY
36,320 25400 4,915 4800 0 0
JAPAN . . 5,512 78030 . .
*TOTAL JAPAN
0 0 5,512 78030 0 0
W GERMANY . . 6,000 8900 48,563 79290
*TOTAL W GERMANY
0 0 6,000 8900 48,563 79290
TOTAL 48,039 25400 31,367 91730 64,388 91290
Now, we'll just do recaps and subfoots for the SALES field:
TABLE FILE CAR
SUM DCOST IN 20 SALES NOPRINT
BY COUNTRY BY CAR
ACROSS SEATS IN 20
IF SEATS FROM 2 TO 5
ON COUNTRY SUB-TOTAL
ON COUNTRY RECAP
COL1/D7 = C2 ;
COL2/D7 = C4 ;
COL3/D7 = C6 ;
ON COUNTRY SUBFOOT
"<20 -----------------------------------"
" *MYSALES <20<COL1> <COL2> <COL3> "
" "
END
-RUN
SEATS
2 4 5
COUNTRY CAR
----------------------------------------------------
ENGLAND JAGUAR 7,427 . 11,194
JENSEN . 14,940 .
TRIUMPH 4,292 . .
*TOTAL ENGLAND 11,719 14,940 11,194
-----------------------------------
*MYSALES 0 0 12,000
FRANCE PEUGEOT . . 4,631
*TOTAL FRANCE 0 0 4,631
-----------------------------------
*MYSALES 0 0 0
ITALY ALFA RO 11,320 4,915 .
MASERAT 25,000 . .
*TOTAL ITALY 36,320 4,915 0
-----------------------------------
*MYSALES 25,400 4,800 0
JAPAN DATSUN . 2,626 .
TOYOTA . 2,886 .
*TOTAL JAPAN 0 5,512 0
-----------------------------------
*MYSALES 0 78,030 0
W GERMANY AUDI . . 5,063
BMW . 6,000 43,500
*TOTAL W GERMANY 0 6,000 48,563
-----------------------------------
*MYSALES 0 8,900 79,290
TOTAL 48,039 31,367 64,388
Note that the columns are in alignment because I changed the format of SALES to the same format as DCOST, which is D7.