Skip to main content

What uniquery syntax will roll up the third column into an unduped list for each unduped item in the second column, all while suppressing display of the first column.

Note that the second column also contains values such as L2, L3, etc.



------------------------------
Shawn Waldie
enterprise application developer
Rocket Forum Shared Account
Los Angeles CA US
------------------------------

What uniquery syntax will roll up the third column into an unduped list for each unduped item in the second column, all while suppressing display of the first column.

Note that the second column also contains values such as L2, L3, etc.



------------------------------
Shawn Waldie
enterprise application developer
Rocket Forum Shared Account
Los Angeles CA US
------------------------------

You could try this, but I suspect it may not be totally what you want, but does provide the result you asked for

list SWALDIE BY A1 BY A2 A1 A2 09:53:50 17 Sep 2024 1
SWALDIE... Col 1..... Col 2.....

1          L1         OP1
2          L1         OP1
3          L1         OP1
4          L1         REP1
5          L1         S1
6          L1         S1
7          L1         S1
8          L2         S1
9          L2         S1
9 records listed

list SWALDIE BY A1 BY A2 BREAK-ON A1 BREAK-ON A2 ID.SUP DET.SUP 09:55:17 17 Sep
2024 1
Col 1..... Col 2.....

           OP1
           REP1
           S1
L1
           S1
L2
9 records listed



------------------------------
Jonathan Smith
UniData ATS
Rocket Support
------------------------------

What uniquery syntax will roll up the third column into an unduped list for each unduped item in the second column, all while suppressing display of the first column.

Note that the second column also contains values such as L2, L3, etc.



------------------------------
Shawn Waldie
enterprise application developer
Rocket Forum Shared Account
Los Angeles CA US
------------------------------

Another way to get the format as you want is to use REFORMAT to send the information to another work file and list that.

:AE DICT SWALDIE A1 A2 A1A2
< 1 > Top of "A1" in "DICT SWALDIE", 6 lines, 16 characters.
001: D
002: 1
003:
004: Col 1
005: 10L
006: S
Bottom.
*--: EX
Quit "A1" in file "DICT SWALDIE" unchanged.
< 2 > Top of "A2" in "DICT SWALDIE", 6 lines, 16 characters.
001: D
002: 2
003:
004: Col 2
005: 10L
006: S
Bottom.
*--: EX
Quit "A2" in file "DICT SWALDIE" unchanged.
< 3 > Top of "A1A2" in "DICT SWALDIE", 6 lines, 36 characters.
001: I
002: N(A1) : "*" : N(A2)
003:
004: New Key
005: 10L
006: S
Bottom.
*--: EX
Quit "A1A2" in file "DICT SWALDIE" unchanged.
:

:CLEAR.FILE DATRA SWALDIE.TEMP

:REFORMAT SWALDIE A1A2
File name : SWALDIE.TEMP

:LIST SWALDIE.TEMP BY EVAL 'FIELD(@ID,"*",1)' BY EVAL 'FIELD(@ID,"*",1)' EVAL 'FIELD(@ID,"*",1)' COL.HDG "A1" EVAL 'FIELD(@ID,"*",2)' COL.HDG "A2" ID.SUP

LIST SWALDIE.TEMP BY EVAL 'FIELD(@ID,"*",1)' BY EVAL 'FIELD(@ID,"*",1)' EVAL 'FI
ELD(@ID,"*",1)' COL.HDG "A1" EVAL 'FIELD(@ID,"*",2)' COL.HDG "A2" ID.SUP 12:03:4
8 17 Sep 2024 1
A1........ A2........

L1         OP1
L1         REP1
L1         S1
L2         S1
4 records listed



------------------------------
Jonathan Smith
UniData ATS
Rocket Support
------------------------------

What uniquery syntax will roll up the third column into an unduped list for each unduped item in the second column, all while suppressing display of the first column.

Note that the second column also contains values such as L2, L3, etc.



------------------------------
Shawn Waldie
enterprise application developer
Rocket Forum Shared Account
Los Angeles CA US
------------------------------

Jonathan is of course right in the BREAK.ON, but that is going to give you two levels of break, which may or may not be what you want. If you are really looking to get a list of the unduped combinations of those two columns, you could combine both into an expression and break on that combination.

LIST SWALDIE BY A1 BY A2 BREAK.ON EVAL "A1:' ':A2" FMT "20L" DET.SUP ID.SUP 12:24:56 Sep 17 2024 1
A1:' ':A2

L1 OP1
L1 REP1
L1 S1
L2 S1
9 records listed

Again, may or may not give you exactly what you want...



------------------------------
Brian Leach
Director
Brian Leach Consulting
Chipping Norton GB
------------------------------

You could try this, but I suspect it may not be totally what you want, but does provide the result you asked for

list SWALDIE BY A1 BY A2 A1 A2 09:53:50 17 Sep 2024 1
SWALDIE... Col 1..... Col 2.....

1          L1         OP1
2          L1         OP1
3          L1         OP1
4          L1         REP1
5          L1         S1
6          L1         S1
7          L1         S1
8          L2         S1
9          L2         S1
9 records listed

list SWALDIE BY A1 BY A2 BREAK-ON A1 BREAK-ON A2 ID.SUP DET.SUP 09:55:17 17 Sep
2024 1
Col 1..... Col 2.....

           OP1
           REP1
           S1
L1
           S1
L2
9 records listed



------------------------------
Jonathan Smith
UniData ATS
Rocket Support
------------------------------

Thank you @Jonathan Smith

This worked for my purposes.



------------------------------
Shawn Waldie
enterprise application developer
Rocket Forum Shared Account
Los Angeles CA US
------------------------------

Jonathan is of course right in the BREAK.ON, but that is going to give you two levels of break, which may or may not be what you want. If you are really looking to get a list of the unduped combinations of those two columns, you could combine both into an expression and break on that combination.

LIST SWALDIE BY A1 BY A2 BREAK.ON EVAL "A1:' ':A2" FMT "20L" DET.SUP ID.SUP 12:24:56 Sep 17 2024 1
A1:' ':A2

L1 OP1
L1 REP1
L1 S1
L2 S1
9 records listed

Again, may or may not give you exactly what you want...



------------------------------
Brian Leach
Director
Brian Leach Consulting
Chipping Norton GB
------------------------------

Very clever, @Brian Leach.

Thank you.



------------------------------
Shawn Waldie
enterprise application developer
Rocket Forum Shared Account
Los Angeles CA US
------------------------------

What uniquery syntax will roll up the third column into an unduped list for each unduped item in the second column, all while suppressing display of the first column.

Note that the second column also contains values such as L2, L3, etc.



------------------------------
Shawn Waldie
enterprise application developer
Rocket Forum Shared Account
Los Angeles CA US
------------------------------

You also have the SAVING UNIQUE query clause. 

SELECT File SAVING UNIQUE Field1 SAVING UNIQUE Field2.

GET.LIST

LIST FILE Field1 Field2.

UniData only supports one SAVING clause in a query, so that would need an I-Descriptor for 'Field1 : "*" : Field2', and then SAVING UNIQUE on the I-Descriptor field. The select list then contains the paired values of interest.



------------------------------
Mark A Baldridge
Principal Consultant
Thought Mirror
Nacogdoches, Texas United States
------------------------------

What uniquery syntax will roll up the third column into an unduped list for each unduped item in the second column, all while suppressing display of the first column.

Note that the second column also contains values such as L2, L3, etc.



------------------------------
Shawn Waldie
enterprise application developer
Rocket Forum Shared Account
Los Angeles CA US
------------------------------

You could also use a SQL query like this:

SELECT DISTINCT A1, A2 FROM SWALDIE;

The semicolon at the end is important.



------------------------------
Charlie Corbett
Programmer
------------------------------

You also have the SAVING UNIQUE query clause. 

SELECT File SAVING UNIQUE Field1 SAVING UNIQUE Field2.

GET.LIST

LIST FILE Field1 Field2.

UniData only supports one SAVING clause in a query, so that would need an I-Descriptor for 'Field1 : "*" : Field2', and then SAVING UNIQUE on the I-Descriptor field. The select list then contains the paired values of interest.



------------------------------
Mark A Baldridge
Principal Consultant
Thought Mirror
Nacogdoches, Texas United States
------------------------------

Thank you, @Mark Baldridge.

I had actually tried this one already, but it didn't provide quite enough visual separation between values to make it beneficial for me.



------------------------------
Shawn Waldie
enterprise application developer
Rocket Forum Shared Account
Los Angeles CA US
------------------------------

You could also use a SQL query like this:

SELECT DISTINCT A1, A2 FROM SWALDIE;

The semicolon at the end is important.



------------------------------
Charlie Corbett
Programmer
------------------------------

Thank you, @Charlie Corbett.

 Do the files have to be vsg'd to run sql queries against them? I wouldn't be able to use this if so.



------------------------------
Shawn Waldie
enterprise application developer
Rocket Forum Shared Account
Los Angeles CA US
------------------------------