Re: sort by two paremeters?

2008-04-14 Thread viktoras didziulis

one more way to do the same if your table is stored in the database is:
SELECT * FROM table ORDER BY 1 asc, 2 asc

best wishes
Viktoras


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: sort by two paremeters?

2008-04-13 Thread Terry Judd
You need to do the second sort first followed by the first sort. So...

set the itemDel to tab -- or whatever your item delimiter is
sort lines of tList numeric by item 2 of each
sort lines of tList by item 1 of each

...that's it.

HTH,

Terry...

On 14/4/08 2:49 PM, "Nicolas Cueto" <[EMAIL PROTECTED]> wrote:

> Before I go ahead and script something complex,
> I'm wondering if Rev already has a built-in way of
> doing the following sort.
> 
> Given a list of 2-item lines, such as
> 
>   a 1
>   d 3
>   c 3
>   c 2
>   a 3
>   d 2
>   a 2
>   c 1
>   d 1
> 
> I'd like the list to be sorted by item 1,
> and, in the case of lines with the
> same item 1, sorted by item 2, thus:
> 
>   a 1
>   a 2
>   a 3
>   c 1
>   c 2
>   c 3
>   d 1
>   d 2
>   d 3
> 
> Any suggestions?
> 
> Thanks.
> 
> --
> Nicolas Cueto
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

-- 
Dr Terry Judd
Lecturer in Educational Technology (Design)
Biomedical Multimedia Unit
Faculty of Medicine, Dentistry & Health Sciences
The University of Melbourne
Parkville VIC 3052
AUSTRALIA

61-3 8344 0187

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: sort by two paremeters?

2008-04-13 Thread Richard Gaskin

Nicolas Cueto wrote:

Before I go ahead and script something complex,
I'm wondering if Rev already has a built-in way of
doing the following sort.

Given a list of 2-item lines, such as

  a 1
  d 3
  c 3
  c 2
  a 3
  d 2
  a 2
  c 1
  d 1

I'd like the list to be sorted by item 1,
and, in the case of lines with the
same item 1, sorted by item 2, thus:

  a 1
  a 2
  a 3
  c 1
  c 2
  c 3
  d 1
  d 2
  d 3

Any suggestions?

Thanks.


Just two successive sorts seem to do the trick.

This script assumes that the source data shown above is in field 1, and 
you want the output shown in field 2:


on mouseUp
  put fld 1 into tData
  sort lines of tData by word 2 of each
  sort lines of tData
  put tData into fld 2
end mouseUp


--
 Richard Gaskin
 Managing Editor, revJournal
 ___
 Rev tips, tutorials and more: http://www.revJournal.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


sort by two paremeters?

2008-04-13 Thread Nicolas Cueto
Before I go ahead and script something complex,
I'm wondering if Rev already has a built-in way of
doing the following sort.

Given a list of 2-item lines, such as

  a 1
  d 3
  c 3
  c 2
  a 3
  d 2
  a 2
  c 1
  d 1

I'd like the list to be sorted by item 1,
and, in the case of lines with the
same item 1, sorted by item 2, thus:

  a 1
  a 2
  a 3
  c 1
  c 2
  c 3
  d 1
  d 2
  d 3

Any suggestions?

Thanks.

--
Nicolas Cueto
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution