I'm trying to sum a by group by highest 1. The code I'm using works when I display all rows; however I need to display the data by group. I don't want to write to a hold file because there are millions of rows. How can I mark the highest rows that need to be counted. I've tried using a define and compute but highest and max doesn't work in define and compute. I've played with last but I'm just not getting it. Example below of what I'm trying to get done:
DEFINE FILE ITEMS DISCONT/I1=IF STAT EQ 'D' THEN 1 ELSE 0; END
TABLE FILE ITEMS SUM STAT DISCONT BY TYPE BY ITEM BY HIGHEST 1 SEQ END
I get the right results with the code above; however I need the data to display as follows:
DEFINE FILE ITEMS DISCONT/I1=IF STAT EQ 'D' THEN 1 ELSE 0; END
TABLE FILE ITEMS SUM DISCONT BY TYPE END
My count is high because it's no longer counting the highest 1. If I use the by I will have to hold data.
Any suggestions!This message has been edited. Last edited by: <Kathryn Henning>,
I'm not exactly sure what your saying here. But it seems that you just don't want to display SEQ. Did I understand that correctly.
If thats the case, then you just need to put NOPRINT after seq. It would look like this:
DEFINE FILE ITEMS
DISCONT/I1=IF STAT EQ 'D' THEN 1 ELSE 0;
END
TABLE FILE ITEMS
SUM
STAT
DISCONT
BY TYPE
BY ITEM
BY HIGHEST 1 SEQ NOPRINT
END
Eric Woerle 8.1.05M Gen 913- Reporting Server Unix 8.1.05 Client Unix Oracle 11.2.0.2
April 29, 2015, 11:27 AM
Starr
Yes I did ask similar question already and that's where I got the idea for HIGHEST 1. However, the data has to be aggregated BY TYPE. When using the BY ITEM and BY HIGHEST 1 SEQ I get multiple rows. I want one row per TYPE and I don't want to hold the file. So I was guessing that I have to use the HIGHEST 1 logic in a define or compute. Sorry I didn't ask in the earlier post but I didn't know there was so much data.