Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Sorting table according custom values

Featured Replies

  • Newbies

Hi,

I have a problem with sorting a table.

I have to sort an adress list according to the norwegian Postal code. that is a code that goes from 0000 to 9999.

The problem is that the norwegian post wants it to be sorted, but not logically!

The codes go from 0000-1499, then to 1700-1799 and then back to 1500-1599 etc.

I know about the custom value list, but that takes "only" 3.000 entries. I obviously need 10.000 entries.

Is there a way i can solve this?

Thanks in advance,

Peter from Norway.

The "etc." part is not clear: is the range 1700-1799 the only exception, or is there a repeating pattern?

You could add an additional "group" field that would auto-enter or calculate like so:

Case( 

      postalCode<1500; 1; 

      postalCode<1600; 3; 

      postalCode<1700; 4; 

      postalCode<1800; 2; 

      etc... ) 

Then sort by group and postal code.

Edited by Guest
I'm assuming there are other exceptions.

  • Author
  • Newbies

First of all, thanks for replying so quickly!

Yes, there are more exceptions. I don't know them by heart (I am at home now, and the list lies at work).

Does that make a difference? I mean... how many exceptions there are?

Peter

  • Author
  • Newbies

Hello, and thanks for reacting!

That sounds like a good idea.

Can you get me started on how to make such a list? I mean... how do i make such a case list?

And does it also work with not only smaller then 1500 (as in your example), but for example between 1400 and 1499?

Peter

I would suggest you create a table of PostalCodeGroups with these fields:

StartingCode (Text)

SortOrder (Number)

Then just enter a record for each group e.g.

"0000", 1 ;

"1700", 2 ;

"1500", 3 ;

"1800", 4 ;

etc.

Define a relationship to this table as:

YourTable::Postal = PostalCodeGroups::StartingCode

In your table, define a SortOrder field as Number, lookup from PostalCodeGroups::SortOrder, lookup next lower.

  • Author
  • Newbies

Thanks for the tip!

Kind of a job to do, but that should work.

Didn't think of solving it like that :

Thanks again!

Peter

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.