You could do something like this:

* Table 1

#+name: table1
| Manufacturer    | Name        | Price |
|-----------------+-------------+-------|
| ACME            | super cheep | 25 $  |
| Roadrunner Inc. | Kaboom      | 27 $  |
| ACME            | cheep       | 30 $  |

#+RESULTS: resorted
| Manufacturer    | Name        | Price |
|-----------------+-------------+-------|
| ACME            | super cheep | 25 $  |
| ACME            | cheep       | 30 $  |
| Roadrunner Inc. | Kaboom      | 27 $  |

** Code for resorting

#+name: resorted
#+BEGIN_SRC emacs-lisp :var data=table1 :colnames t
(sort data (lambda (row1 row2) (string< (first row1) (first row2))))
#+END_SRC

John

-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Thu, Oct 1, 2020 at 4:57 AM Axel Kielhorn <org-m...@axelkielhorn.de>
wrote:

> Hello!
>
> I have a table that I want to show with two different sorting orders but I
> don’t want to maintain the data twice.
>
>
> * Table 1
>
> | Manufacturer    | Name        | Price |
> |-----------------+-------------+-------|
> | ACME            | super cheep | 25 $  |
> | Roadrunner Inc. | Kaboom      | 27 $  |
> | ACME            | cheep       | 30 $  |
>
> *  Table 2
>
> | Manufacturer    | Name        | Price |
> |-----------------+-------------+-------|
> | ACME            | cheep       | 30 $  |
> | ACME            | super cheep | 25 $  |
> | Roadrunner Inc. | Kaboom      | 27 $  |
>
> Is there a way to do this in org?
> Right now I copy the table and apply an =C-c ^ a= on the first column.
>
> Greetings
> Axel
>

Reply via email to