Control break summaries in QTP
Hamilton, Allison
Allison.Hamilton@Cognos.COM
Tue, 14 Sep 1999 13:26:04 -0400
Ahhh.... if I do say so myself - the Tracer is wonderful - what is happening
is that the item AT is done at the end of the sort break, but the output is
done at the DETAIL time - which is first - so the subtotalling isn't done
yet. I would normally suggest that you add an AT <sort break> on the OUTPUT
statement - but that doesn't seem to be possible as you have duplicate
records at that sort break... But that is what's happening.
Allison Hamilton
> ----------
> From: Rich `Lego-Man' Jesse - 7633[SMTP:RJESSE@QTIWORLD.COM]
> Sent: Tuesday, September 14, 1999 12:02 PM
> To: powerh-l@lists.swau.edu
> Subject: Control break summaries in QTP
>
> Help!
>
> I need to convert a QUIZ program to QTP, because the subfile output by the
> QUIZ
> report is moving in to our Oracle 7.3.4 DB (HP/UX 10.20, PH 7.33.D3).
>
> Here's what I've got so far:
>
> RUN MYTEST
>
> REQUEST MYTEST &
> ON CALCULATION ERRORS REPORT
>
> SET PROCESS NOLIMIT
>
> SET LOCK FILE UPDATE
>
> ACCESS MYTABLE_1 &
> LINK WORK_ORDER OF MYTABLE_1 VIAINDEX MYTABLE_2_WORK_ORDER TO
> MYTABLE_2
>
> DEFINE COMPARE_TODAYS_DATE NUM = DAYS(SYSDATE)
> DEFINE D_TODAYS_DATE DATE = SYSDATE
> DEFINE D_MYDATE NUM = DAYS(MYDATE OF MYTABLE_2)
> DEFINE D_MASTER_LABEL_COUNT NUM*5 = 1
> DEFINE D_QTY_TO_KIT FLOAT SIZE 8 = (TQTY OF MYTABLE_1 + AQTY OF
> MYTABLE_1)
>
> DEFINE SORT_WO_OPER_ASSY CHAR*34 = WORK_ORDER OF MYTABLE_1 + &
> + PARENT_PART_NUMBER OF MYTABLE_1
> DEFINE SHORTAGE_ITEM NUM*1 = 1 IF (D_MYDATE >= COMPARE_TODAYS_DATE) OR
> &
> COMPLETED_FLAG OF MYTABLE_2 = " ") ELSE 0
> DEFINE D_BIN_COUNT NUM*5 = 1 IF (1 = SHORTAGE_ITEM) ELSE 0
>
> DEFINE COMPPART_NUM NUM*15 = NCONVERT(TRUNCATE(PART_NUMBER OF
> MYTABLE_1))
>
> TEMPORARY T_MASTER_LABEL_COUNT NUM*5
> ITEM T_MASTER_LABEL_COUNT SUBTOTAL D_MASTER_LABEL_COUNT
>
> TEMPORARY T_BIN_COUNT NUM*5
>
> SELECT IF 0 <> D_QTY_TO_KIT
>
> SELECT MYTABLE_2 IF &
> D_MYDATE <= COMPARE_TODAYS_DATE
>
> SORT &
> ON SHORTAGE_ITEM &
> ON MYDATE OF MYTABLE_2 &
> ON SORT_WO_OPER_ASSY &
> ON COMPPART_NUM
>
> ITEM T_BIN_COUNT SUBTOTAL D_BIN_COUNT AT SORT_WO_OPER_ASSY
>
> OUTPUT QT_MYTEST_TABLE ADD
> ITEM MYDATE FINAL MYDATE OF MYTABLE_2
> ITEM WORK_ORDER FINAL WORK_ORDER OF MYTABLE_1
> ITEM PARENT_PART_NUMBER FINAL PARENT_PART_NUMBER OF
> MYTABLE_1
> ITEM PART_NUMBER FINAL PART_NUMBER OF MYTABLE_1
> ITEM QTY_TO_KIT FINAL D_QTY_TO_KIT
> ITEM MASTER_LABEL_COUNT SUBTOTAL T_MASTER_LABEL_COUNT
> ITEM BIN_COUNT FINAL T_BIN_COUNT
>
> The problem is that "BIN_COUNT" misses the first group of WORK_ORDER
> records.
> In other words, there is a set of records in the output that should have a
> BIN_COUNT = "1". Instead it's "0", throwing off the BIN_COUNT of every
> other
> group of WORK_ORDER records.
>
> My goal is to assign a new BIN_COUNT for every group of records with the
> same
> WORK_ORDER whose SHORTAGE_ITEM = 1. For example:
>
> WORK_ORDER PARENT_PART_NUMBER PART_NUMBER MASTER_LABEL_COUNT
> BIN_COUNT
> 12345 ABCDEF XYZD 1 0
> 12456 ABCDEF YYX 2 0
> 12789 ABCDEF ZXCXC 3 0
> 13456 ABCD DEFGHI 4 1
> 13456 ABCD EFGHH 5 1
> 13456 ABCD HIJKLM 6 1
> 14567 ABCDEFG REJ 7 2
> 14567 ABCDEFG SRTRTY 8 2
> 14567 ABCDEFG TYTRY 9 2
> 14567 ABCDEFG UIHHFG 10 2
>
> This is what a sample of the output *should* look like. What's happening
> to
> me is WORK_ORDER "13456" is getting a BIN_COUNT of "0", which causes
> WORK_ORDER
> "14567" to have a BIN_COUNT of "1", etc.
>
> Any ideas??? I *thought* I was using the ITEMs and TEMPs correctly,
> but...
>
> TIA!!!
> Rich Jesse Programmer/Analyst
> (/DBA/SysAdmin/etc.)
> rjesse@qtiworld.com Quad/Tech International, Sussex,
> WI USA
>
>
> = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> =
> Subscribe: "subscribe powerh-l" in message body to
> majordomo@lists.swau.edu
> Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
> powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
> This list is closed, thus to post to the list, you must be a subscriber.
>
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.