Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting

Status
Not open for further replies.

NewToThis2

Technical User
Mar 30, 2004
62
US
CR V9
I have a table grouped by the object id field. Under each object id group there is the field {Matrix_cat} which contains various results such as email, name-first, name-last, portalrole, etc.

I need to sort the Matrix_cat. I need to see {EMAIL} first, even if there is no {EMAIL} for a group, I want to see the word email with a blank result (that quickly tells me I'm missing an email) . Each additional field following {EMAIL} needs to be in alpha order. Here's the result I'm looking for:

EMAIL john.doe@wizard.com
Name-First John
Name-Last doe
Portarole Administrator

EMAIL
Name-First Judy
Name-Last Blue
Wizard Base 3

Here's the sql:
SELECT `Sheet1_`.`DATE`, `Sheet1_`.`DESCRIPTION`, `Sheet1_`.`ID-RECORD`, `Sheet1_`.`ID-TYPE`, `Sheet1_`.`MATRIX-CAT`, `Sheet1_`.`MATRIX-TYPE`, `Sheet1_`.`MX-VALUE`, `Sheet1_`.`OBJ-ID`
FROM `Sheet1$` `Sheet1_`
WHERE `Sheet1_`.`MATRIX-CAT`<>'DEFRPTTYPE'
ORDER BY `Sheet1_`.`OBJ-ID`, `Sheet1_`.`MATRIX-CAT`


Thanks!
 
The additional fields aren't in alpha order in your example, so I'll forego that aspect.

How do you know what is in each field? I'll assume that some field is the indicator:

Create seperate fields for each:

Group Header:
stringvar Email:="";
stringvar FName:="";
etc...

Details section formulas:
stringvar Email;
if {table.field} = "Email" then
email:={table.cat}

stringvar FName;
if {table.field} = "Fname" then
Fname:={table.cat}

To display the results, use the group footer:

Group Footer formulas:
stringvar Email

stringvar FName

etc.

-k

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top