I've been trying for 2 days to get a report to work, and I hope someone here can help me out.
I need to dense data in a report. I'm using the nodata, and it works fine for the first set of data, but when I add another by field, it only denses the first by field.
What I need to end up with is something like this.
country bodytype car england convertible jaguar sedan jaguar hardtop triumph coupe NONE roadster NONE france convertible NONE sedan peugeot hardtop NONE coupe NONE roadster NONE
Any ideas would be greatly appreciated.
August 02, 2005, 06:46 PM
Francis Mariani
Will this do what you require:
SET NODATA=NONE TABLE FILE CAR SUM CAR SALES NOPRINT BY COUNTRY BY BODYTYPE ROWS 'CONVERTIBLE' OVER 'HARDTOP' OVER 'SEDAN' OVER 'ROADSTER' BY CAR NOPRINT END
August 02, 2005, 07:55 PM
Raini
wow, this looks great. I'll drop it in my code and see what happens. thanks so much!!!!!
August 03, 2005, 05:07 AM
Raini
That code worked great. One last question. Can anyone think of a way to make the rows dynamic? My data changes too much for me to hard the rows.
I wish I had come here two days ago.
August 03, 2005, 12:56 PM
Tony A
Hi Raini,
The following code should do it for you
SET NODATA=NONE SET HOLDLIST = PRINTONLY TABLE FILE CAR BY BODYTYPE ON TABLE SAVE AS BODYTYPES FORMAT ALPHA END -RUN -SET &Rows = 'ROWS '; -READ BODYTYPES, NOCLOSE &Bodytype -REPEAT Read_It WHILE (&IORETURN EQ 0); -SET &Rows = &Rows | '''&Bodytype.EVAL'''; -READ BODYTYPES, NOCLOSE &Bodytype -SET &Rows = IF &IORETURN EQ 0 THEN &Rows | ' OVER ' ELSE &Rows; -Read_It -RUN TABLE FILE CAR SUM CAR BY COUNTRY BY BODYTYPE &Rows BY CAR NOPRINT END -EXITThis message has been edited. Last edited by: Tony A,
August 03, 2005, 02:10 PM
Raini
'NOCLOSE' is a new one for me. I'm on 5.2.3 in a windows nt environmen. I don't think NOCLOSE works for me.
Other than that, I think the code is brilliant.
August 03, 2005, 03:34 PM
Tony A
Hi Raini,
NOCLOSE is an option on a -READ statement that keeps the file open and the row pointers intact and has been around for a few years now.
It should function with 5.2.3 OK.
August 03, 2005, 04:04 PM
Raini
You're right. There is something going on with my data. I have to do a match to get the list, and somethere weird is happening after that.