December 08, 2005, 11:20 AM
Ginnydata for last month?
I have a report that I am trying to copy. It is currently laid out in an excel spread sheet and users get data from several places and put the data in. It is grouped by month and one month row would have all the tickets opened that month, all the tickets closed that month and all the tickets opened from the month before.
My code is
TABLE FILE CALLLOG
SUM
CNT.CALLID AS 'TOTAL CALLS, TAKEN'
BY
OPENMONTH
WHERE ( RECDDATE GE '01/01/2005' );
This gets me the first thing that I want which would be the total calls opened that month. But how can I in that same row grouped by that date put in Total calls Closed that month. The by would be different for that particular data as it would be by CLOSEMONTH.
December 08, 2005, 12:07 PM
codermonkeyOff the top of my head, how about trying a MATCH? I assume OPENMONTH and CLOSEMONTH are the same format (or else this won't work).
MATCH FILE CALLLOG
SUM CNT.CALLID AS 'CALLS_TAKEN'
BY OPENMONTH AS 'MONTH'
WHERE ( RECDDATE GE '01/01/2005' )
RUN
FILE CALLLOG
SUM CNT.CALLID AS 'CALLS_CLOSED'
BY CLOSEMONTH AS 'MONTH'
WHERE ( RECDDATE GE '01/01/2005' )
AFTER MATCH HOLD AS HOLD1 OLD-OR-NEW
END
TABLE FILE HOLD1
PRINT CALLS_TAKEN AS 'TOTAL CALLS, TAKEN'
CALLS_CLOSED AS 'TOTAL CALLS, CLOSED'
BY MONTH
END
I may not have gotten this completely right, depending on if I understand what you are trying to do, but give it a try.
December 13, 2005, 02:22 PM
GinnyThat was exactly what I needed it worked perfectly. Thank you so much!
December 13, 2005, 03:39 PM
GinnyIs there a way to put a compute in this? I tried this
MATCH FILE CALLLOG
SUM CNT.CALLID AS 'CALLS_TAKEN'
COMPUTE VSPERC/D12.2% = CSVERYSAT / SURVEYTOTAL * 100;
BY OPENMONTH AS 'MONTH'
WHERE ( RECDDATE GE '01/01/2005' )
RUN
FILE CALLLOG
SUM CNT.CALLID AS 'CALLS_CLOSED'
BY CLOSEMONTH AS 'MONTH'
WHERE ( RECDDATE GE '01/01/2005' )
AFTER MATCH HOLD AS HOLD1 OLD-OR-NEW
END
TABLE FILE HOLD1
PRINT CALLS_TAKEN AS 'TOTAL CALLS, TAKEN'
CALLS_CLOSED AS 'TOTAL CALLS, CLOSED'
BY MONTH
END
But I receive an error saying that computes are not allowed in match files
December 13, 2005, 04:35 PM
GinnyI figured it out, I moved the compute to the table file hold1 area. Thanks again for your help.