Quiz quandry

MaxButen maxbuten@home.com
Sun, 18 Apr 1999 10:02:22 -0400


Here's another solution that doesn't depend on "KEY" being a key:

ACC FILEA
DEF DATA-A CHA*3 = DATA
DEF DATA-B CHA*3 = ""
DEF KOUNT = 1
SORT ON KEY ON DATA-A
SET SUBFILE AT DATA-A NAME FILEC
REPORT SUMMARY  & 
  KEY           & 
  KOUNT SUBTOTAL AT KEY RESET AT KEY & 
    ;; above is supposed to give a separate kount for each DATA-A:
1,2,3, etc.
    ;; If it doesn't work in Quiz, you can do it in QTP.
  DATA-A        & 
  DATA-B
GO


ACCESS FILEB
DEF DATA-A CHA*3 = ""
DEF DATA-B CHA*3 = DATA
DEF KOUNT = 1
SORT ON KEY ON DATA-B
SET SUBFILE AT DATA-B NAME FILEC APPEND
REPORT SUMMARY  & 
  KEY           & 
  KOUNT SUBTOTAL AT KEY RESET AT KEY & 
  DATA-A        & 
  DATA-B
GO


ACCESS *FILEC
SORT ON KEY ON KOUNT
FOOTING AT KOUNT & 
  KEY PRINT AT KEY  & 
  DATA-A         & 
  DATA-B
FOOTING AT KEY SKIP 2
GO

-- 
Max Buten - Powerhouse Programming Consultant - maxbuten@home.com  (610)
664 2301
http://members.home.net/maxbuten/


Jeff Hoffman wrote:
> 
> You could try this:
> 
> Pass 1 QTP
> 
> acc keyfile link key to filea &
>              and key to fileb
> 
> set process nolimit
> set lock file update
> set file keyfile open read share
> set file filea   open read share
> set file fileb   open read share
> 
> sorted on key
> 
> temp preva char*2  initial " "
> temp prevb char*2  initial " "
> temp vala  char*2
> temp valb  char*2
> 
> item vala  = dataa of filea if dataa of filea <> preva else " "
> item valb  = datab of fileb if datab of fileb <> prevb else " "
> 
> item preva = dataa of filea reset at key to " "
> item prevb = datab of fileb reset at key to " "
> 
> subfile sub1 keep include key,vala,valb
> 
> go
> exit
> 
> Pass 2 QUIZ
> 
> acc *sub1
> rep key vala valb
> go
> 
> At 12:43 pm 16/04/99 -0700, Mike Palandri wrote:
> >Hi all,
> >
> >I'm trying to write a report that does not fit into the
> >Quiz processing model.
> >
> >There are two files with the same keyfield, each with one
> >or more records per key value, so for any key value,
> >file A could have more records than file B, or vice versa,
> >e.g.:
> >
> >File A:
> >
> >Key Data
> >1   aa
> >1   bb
> >2   aa
> >3   aa
> >3   bb
> >3   cc
> >3   dd
> >4   aa
> >5   aa
> >5   bb
> >
> >File B:
> >
> >Key Data
> >1   xx
> >2   xx
> >2   yy
> >3   xx
> >3   yy
> >5   xx
> >5   yy
> >5   zz
> >
> >
> >I'd like to report the key and data from each file side by
> >side like this (this will look goofy in a proportional font):
> >
> >     File A   File B
> >Key  Data     Data
> >1    aa       xx
> >     bb
> >
> >2    aa       xx
> >              yy
> >
> >3    aa       xx
> >     bb       yy
> >     cc
> >     dd
> >
> >4    aa
> >
> >5    aa       xx
> >     bb       yy
> >              zz
> >
> >
> >If I link on the key field I get a record complex that
> >contains a number of records that is a multiple if the
> >records for key values in File A and File B, e.g. for a
> >key value of "3" the record complex looks like this:
> >
> >
> >     File A   File B
> >Key  Data     Data
> >3    aa       xx
> >3    aa       yy
> >3    bb       xx
> >3    bb       yy
> >3    cc       xx
> >3    cc       yy
> >3    dd       xx
> >3    dd       yy
> >
> >
> >In the past I've sorted by either file A data or File B
> >data and reported the detail as a "foot at", but as you
> >can see, that won't work here.
> >
> >Has anyone had experience with this type of reporting?
> >
> >Thanks,
> >
> >
> >
> >Mike
> >
> >
> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> + Jeff Hoffman                         + e-mail: J.Hoffman@cchs.usyd.EDU.AU +
> + Director                             +                                    +
> + WoniCon Pty Ltd                      +                           ,-_|\    +
> + 21 Prices Circuit                    +  voice: +61 2 9542 1527  /     \   +
> + Woronora    NSW     2141             +    fax: +61 2 9521 3979  \_,-._*   +
> + AUSTRALIA                            +                               v    +
> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
> +
> = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> 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.