Link 2 subfiles in QTP?

stuartr@ihot.com stuartr@ihot.com
Thu, 13 Apr 2000 21:34:37 GMT


Hi Valerie,

It has been a few years since I linked subfiles in PowerHouse but, basically, in 
order to link non indexed subfiles you need to link by record number.  

I have not linked multiple subfiles in QTP but, I have done it in QUIZ and I 
believe it is the same principal for QTP.  

What I did in the past was create s simple numeric variable set equal to one (1) 
in the first pass, sort data by the item you want to link then when writing the 
first subfile, include the numeric item in the subfile subtotalling at the sort 
key.  Here is a simple codeing example:

ACCESS ORDERS
DEFINE LINK_ITEM NUMERIC = 1
SORT ON ORDER_NUMBER
SUBFILE SUBA INCLUDE &
  ORDER_NUMBER, PRODUCT, LINK_ITEM SUBTOTAL AT ORDER_NUMBER NORESET
GO
;
ACCESS VENDORS  LINK TO ...
SORT ON ORDER_NUMBER
SUBFILE SUBB INCLUDE ORDER_NUMBER, VENDOR_NAME
GO
;
ACCESS *SUBA  LINK TO RECORD(LINK_ITEM - 1) OF *SUBB
..


NOTES:  

1) The record numbers (on HP3000 anyway) start with zero so, you must subtract 
one from the Link Item when linking the subfiles.

2) The example above assumes a many-to-one or one-to-one relationship between 
Subfile a and Subfile b.  You will need to play with the sorting and 
subtotalling and do lots of testing to make sure the linkages work correctly.

Hope this helps.

Best Regards,
Stuart J. Rosenboom
stuartr@ihot.com




> 
> Is it possible to link 2 direct access (non indexed) subfiles in QTP ver
> 8.09?
> How would I make the explicit linkage?
> Is  it possible to do this?  I am still learning Powerhouse, if you couldn't
> tell.
> 
> simple example:
> subfile a
> item 1 order number
> item 2 product
> 
> subfile b
> item 1 order number 
> item 2 vendor name
> 
> Thank you
> = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
> Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
> 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
This list is closed, thus to post to the list, you must be a subscriber.