Re: Need to Sort Multilevel Data List
- From: "NickH" <hewett_nick@xxxxxxxxxxx>
- Date: 30 Jan 2007 08:54:05 -0800
Ron & Tom,
Thanks for your replies. Both of you are correct with your first
descriptions - I didn't attempt to mimic a table layout because I've
tried it before with horribly misleading results. Anyway here goes...
1.0.0 Description | Blank | Blank | 1.0.0 ID | Status | Priority |
Etc.
Blank | 1.1.0 Description | Blank | 1.1.0 ID | Status | Priority |
Etc.
Blank | Blank | 1.1.1 Description | 1.1.1 ID | Status | Priority |
Etc.
Blank | Blank | 1.1.2 Description | 1.1.2 ID | Status | Priority |
Etc.
Blank | Blank | 1.1.3 Description | 1.1.3 ID | Status | Priority |
Etc.
Blank | 1.2.0 Description | Blank | 1.2.0 ID | Status | Priority |
Etc.
Blank | Blank | 1.2.1 Description | 1.2.1 ID | Status | Priority |
Etc.
2.0.0 Description | Blank | Blank | 2.0.0 ID | Status | Priority |
Etc.
Blank | 2.1.0 Description | Blank | 2.1.0 ID | Status | Priority |
Etc.
Blank | Blank | 2.1.1 Description | 2.1.1 ID | Status | Priority |
Etc.
Blank | 2.2.0 Description | Blank | 2.2.0 ID | Status | Priority |
Etc.
Blank | Blank | 2.2.1 Description | 2.2.1 ID | Status | Priority |
Etc.
There are more columns of course but I am chiefly interested in
sorting by Status or Priority. I've put the hierarchy numbers
in for clarity - they don't actually exist but I could create them if
I thought it would help (which I don't at this point).
My latest idea is this (it appears to work on a small data set)...
1) To the right, add a column that simply contains the row number of
each row - this will be purely to allow me to restore the data to its
current state, which has hierarchical significance. Let's call it the
'Restore' column.
2) Sort the data by 'Status' (or whatever)
3) Add another column containing the row numbers as the list is now
sorted. Let's call it the 'Tag' column
4) Sort the data by the 'Restore' column
Now the clever bit - which I'm hoping will process fairly quickly...
5) Add a 'NewSort' column which will contain...
For Level1, the 'Tag' number
For Level2, the Level1 tag number + 0.00001 * its own tag number
For Level3, the Level2 tag number + 0.0000000001 * its own tag
number
6) Sort the data by 'NewSort' - Done!
Please let me know if you see any holes in my logic or if there's a
much simpler way that I'm missing.
Best regards,
NickH
PS. Loads of respect for you Tom - your a great contributor and I've
gained a lot of help from solutions that you've provided for others in
the past. :)
.
- Follow-Ups:
- Re: Need to Sort Multilevel Data List
- From: NickH
- Re: Need to Sort Multilevel Data List
- References:
- Need to Sort Multilevel Data List
- From: NickH
- RE: Need to Sort Multilevel Data List
- From: Tom Ogilvy
- Need to Sort Multilevel Data List
- Prev by Date: Re: Last 4 digits of SSN
- Next by Date: Re: Need to Sort Multilevel Data List
- Previous by thread: RE: Need to Sort Multilevel Data List
- Next by thread: Re: Need to Sort Multilevel Data List
- Index(es):
Relevant Pages
|