dbTalk Databases Forums  

UniQuery equivalent of AQL statement sought

comp.databases.pick comp.databases.pick


Discuss UniQuery equivalent of AQL statement sought in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
michael@preece.net
 
Posts: n/a

Default UniQuery equivalent of AQL statement sought - 10-17-2005 , 09:00 PM






Given files like this:

File Name : FILE1
Key : Task Number
001 : Technician Key
002 : Status

File Name : FILE2
Key : Technician Key
001 : Name

The requirement is to produce a listing like this:

===
Technician Status Items

Joe Bloggs Closed 3
Joe Bloggs Open 2
*** 5

Adam Smith Closed 4
Adam Smith Open 1
*** 5

Total Tasks 10
===

If this was on D3 I'd create dictionaries like this:
File : FILE1
Key : Task
001 : A
002 : 0
003 : Task
009 : R
010 : 9

File : FILE1
Key : ItemCount
001 : S
002 : 0
003 : Items
008 : f;c1
009 : R
010 : 5

File : FILE1
Key : Tech
001 : A
002 : 1
003 : Technician]Identifier
009 : L
010 : 10

File : FILE1
Key : Tech0
001 : S
002 : 1
003 : \
009 : L
010 : 0

File : FILE1
Key : TechName
001 : S
002 : 1
003 : Technican Name
008 : tFILE2;X;;1
009 : L
010 : 30

File : FILE1
Key : Status
001 : Status
002 : A
003 : 2
009 : L
010 : 6

Then I could do something like this (although I can't test this just
now):
SORT FILE1 BY TECHNAME BY TECH BY STATUS ROLL-ON TECH0 TECHNAME ROLL-ON
STATUS TOTAL ITEMCOUNT ID-SUPP DET-SUPP

How would you do this using UniQuery (I guess there would be fewer
dictionary items needed as EVALs could be used instead)?

Mike.


Reply With Quote
  #2  
Old   
Colin Alfke
 
Posts: n/a

Default Re: UniQuery equivalent of AQL statement sought - 10-18-2005 , 12:34 AM






I've found Uniquery can be a lot more powerful than Access but have always
had trouble with the break-on's. We don't do much Uniquery reporting so I
usually just "cheat" and stick the values together.

You can try:
SORT FILE1 BY TECH BY STATUS BREAK.SUP "'T'" TECHNAME BREAK.ON EVAL
"TECHNAME:' ':STATUS" TOTAL COUNTER ID.SUP DET.SUP

Note this will be slightly different if you use the Pick style parser
(udt.options 2 on) - the main thing being that EVAL won't work so you have
to create another dictionary that combines the two.

Where:

TECH
001: D
002: 1
003:
004: Technician]Identifier
005: 10L
006: S

STATUS
001: D
002: 2
003:
004: Status
005: 6L
006: S

TECHNAME
001: I
002: TRANS(FILE2,TECH,1,'X')
003:
004: Technician Name
005: 30L
006: S

COUNTER
001: I
002: "1"
003:
004: Counter
005: 5R
006: S

Hth
Colin Alfke
Calgary Canada

<michael (AT) preece (DOT) net> wrote

Quote:
Given files like this:

File Name : FILE1
Key : Task Number
001 : Technician Key
002 : Status

File Name : FILE2
Key : Technician Key
001 : Name

The requirement is to produce a listing like this:

===
Technician Status Items

Joe Bloggs Closed 3
Joe Bloggs Open 2
*** 5

Adam Smith Closed 4
Adam Smith Open 1
*** 5

Total Tasks 10
===

If this was on D3 I'd create dictionaries like this:
File : FILE1
Key : Task
001 : A
002 : 0
003 : Task
009 : R
010 : 9

File : FILE1
Key : ItemCount
001 : S
002 : 0
003 : Items
008 : f;c1
009 : R
010 : 5

File : FILE1
Key : Tech
001 : A
002 : 1
003 : Technician]Identifier
009 : L
010 : 10

File : FILE1
Key : Tech0
001 : S
002 : 1
003 : \
009 : L
010 : 0

File : FILE1
Key : TechName
001 : S
002 : 1
003 : Technican Name
008 : tFILE2;X;;1
009 : L
010 : 30

File : FILE1
Key : Status
001 : Status
002 : A
003 : 2
009 : L
010 : 6

Then I could do something like this (although I can't test this just
now):
SORT FILE1 BY TECHNAME BY TECH BY STATUS ROLL-ON TECH0 TECHNAME ROLL-ON
STATUS TOTAL ITEMCOUNT ID-SUPP DET-SUPP

How would you do this using UniQuery (I guess there would be fewer
dictionary items needed as EVALs could be used instead)?

Mike.




Reply With Quote
  #3  
Old   
michael@preece.net
 
Posts: n/a

Default Re: UniQuery equivalent of AQL statement sought - 10-19-2005 , 08:36 PM



Thanks for that Colin. I did post a reply via PickSource thanking you
but it never came through.

One thing that didn't work ideally was that the column being broken on,
the one with the EVAL, had the EVAL "workings" as the column header. Is
there a way to specify an alternative column header for an EVAL? I got
'round this by creating a dictionary item and breaking on that instead.
Since then the requirements changed a bit too. Now they want to capture
the output as a table for use within a VB front-end, so the dictionary
looks like this:

SORT DICT FILE1 TYP LOC CONV MNAME FORMAT SM ASSOC BY TYP BY LOC BY @ID
11:33:35
20 OCT 2005 1

@ID............ TYP LOC.......... CONV MNAME.......... FORMAT SM
ASSOC.....


@ID D 0 FILE1 10L S

TECH D 1 Technician 10L S

STATUS D 2 Status 6L S

COUNTER I "1" Counter 5R S

TECHNAME I TRANS(FILE2,T Technician Name 30L S

ECH,1,'X')

TECHSTATUS I FMT(TECHNAME, Technician 37L S

'30L'):' ':ST

ATUS Status

6 records listed

....and the UniQuery statement is like this:

SORT FILE1 BY TECHNAME BY TECH BY STATUS BREAK.ON TECHSTATUS TOTAL
COUNTER HDR.S
UPP COL.HDR.SUPP ID.SUP DET.SUP



Adam Smith Closed 4

Adam Smith Open 1

Joe Bloggs Closed 3

Joe Bloggs Open 2

=======

TOTAL 10

10 records listed

Is there a way to get rid of everything from the "======" line down
inclusive?

Cheers and thanks,
Mike.


Reply With Quote
  #4  
Old   
michael@preece.net
 
Posts: n/a

Default Re: UniQuery equivalent of AQL statement sought - 10-19-2005 , 09:01 PM



There is the possibility that two or more technician identifiers could
have the same name (unlikely in the real world but hey - it has to be
allowed for). What I want to break on then is TECH:" ":STATUS, but what
I want to display on each break line is TECHNAME:" ":STATUS. I haven't
been able to figure out how to do this. Can you?

Cheers
Mike.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.