# Hi appsheet community, I've an ORDERBY() cha...

(Diogenes ASBL - VZW) #1

Hi appsheet community,

I’ve an ORDERBY() challenge:

I want to organize my dropdown column [places] according to their popularity. For this purpose, in the table next to the column [places] I created a virtual column [popularity] with a count formula that adds up the number of times that space has been selected.

For the dropdown I wanted to use this formula:

ORDERBY (Brussels [ID], [places]) => dropdown is ordered alphabetically in places.

Is there a way I can arrange [places] via [popularity]?

ORDERBY(Brussels[ID], [popularity], TRUE, [places], FALSE)

That should order it first by popularity descending, then by places alphabetically, ascending…

(Stephen Mattison) #3

@Diogenes_ASBL_VZW This is a useful setup, can you please post your VC Count formula setup? Thx!

(Diogenes ASBL - VZW) #4

Fantastic!

(Diogenes ASBL - VZW) #5

VC Formula: [popularity] =COUNT(SELECT(Registration[ID], [_THISROW].[Places] = [Places]))

Registration: table where user fill in the places of interest. [_THISROW].[Places]: refering to the column places of each row in tabel registration

[Places]: column in table

I hope this helps … Greetings

(Diogenes ASBL - VZW) #7

@Grant_Stead In the case you use a dependend dropdown, it seems you can’t use orderby()?

Is this correct?

thx

@Diogenes_ASBL_VZW not sure

(Aleksi Alkio) #9

For the dependent dropdown you could try to use SORT expression.

(Diogenes ASBL - VZW) #10

Here is a formula that works to order a dependent dropdown column:

=IN([_THIS], Orderby( SELECT(List Lieux[Lieu],[_THISROW].[Sorte Lieu]=[Sorte Lieu]), [Nombre Interventions],True, [Lieu],False ))

Translate