December 22, 2004, 03:55 AM
thangamAvoid nesting of Across
I want display item count across item status and location in the same report.
i.e.,
Expected:
Status 1 status 2 status3 location1 location 2
1 2 0 9 8
But when I apply across on item, across fields are being nested.
i.e.,
Actual:
location1 location2
status 1 status 2 status 3 status 1 staus 2
val1 val2 val3 val4 val5
How do I avoid it? or How can I get the expected report?
December 22, 2004, 08:09 PM
reFOCUSingWhat does the data look like in the table you are trying to do the across on?
Does it look like this:
Column1 Column2
Value 1 Status 1
Value 2 Status 2
Value 3 Status 3
Value 4 Location 1
Value 5 Location 2
December 23, 2004, 01:49 AM
thangamThe data in the table is as follows
Item1 status1 location1
Item2 status1 location2
Item3 status2 location2
Item4 status3 location1
The expected output is
status1 status2 status3 location1 location2
2 1 1 2 2
December 23, 2004, 02:15 AM
PiipsterDEFINE FILE tablename
STAT1/I5 = IF STATUS EQ 'status1' THEN 1 ELSE 0;
STAT2/I5 = IF STATUS EQ 'status2' THEN 1 ELSE 0;
STAT3/I5 = IF STATUS EQ 'status3' THEN 1 ELSE 0;
LOC1/I5 = IF LOCATION EQ 'location1' THEN 1 ELSE 0;
LOC2/I5 = IF LOCATION EQ 'location2' THEN 1 ELSE 0;
END
TABLE FILE tablename
SUM STAT1 STAT2 STAT3 LOC1 LOC2
END
December 23, 2004, 08:04 AM
thangamStatus and Location information are coming from relevant mater tables.
I don't want to hardcode any values in my report.
Can someone help me?
December 23, 2004, 08:20 AM
thangamStatus and Location information are coming from relevant mater tables.
I don't want to hardcode any values in my report.
Can someone help me?
December 23, 2004, 10:29 AM
thangamStatus and Location information are coming from relevant mater tables.
I don't want to hardcode any values in my report.
Can someone help me?
December 23, 2004, 02:43 PM
reFOCUSingTry this:
SET ASNAMES = ON
TABLE FILE CAR
SUM
RETAIL_COST
MAX.CAR/A20 AS 'ACROSS_FIELD'
BY CAR NOPRINT
ON TABLE HOLD AS HOLD1 FORMAT ALPHA
END
-RUN
TABLE FILE CAR
SUM
RETAIL_COST
MAX.COUNTRY/A20 AS 'ACROSS_FIELD'
BY COUNTRY NOPRINT
ON TABLE HOLD AS HOLD2 FORMAT ALPHA
END
-RUN
TABLE FILE HOLD1
SUM
RETAIL_COST
ACROSS ACROSS_FIELD
MORE
FILE HOLD2
END
-RUN
Hope this is what your looking for.
Note the COUNTRY field and CAR field need to be the same size for this to work.
December 24, 2004, 03:40 AM
thangamThank you. Really forum helped me a lot.
Thank you all.