Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

empty fields sort to the top (ascending)


This topic is 4298 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi Everyone,

 

Apologies, as this must have been asked before (I have searched and browsed).

 

I have a portal sorted in the Length_of_Time since i've spoken to a person, with those most recent at the top. If i haven't spoken to a person, their field is empty. When i sort, empties go to the top ... https://www.filemaker.com/12help/html/find_sort.5.25.html 

 

Is there anyway to get them to the bottom, so that only those i've spoken to most recently are at the top?

 

(I was thinking a kludgey way of doing it would be to say that if i've never spoken to them, set the Length_of_Time to a huge number, but it's not that pretty!)

 

Many thanks for any help

Slater

Posted

To get the longest time at the top, you'd have to sort descending, and that would never get the empties at the top.  Or am I missing something?

Posted

perhaps you could create another field that would start out with a particular value - not having spoken to them, then would change to another value when you do speak to them (this could be a calc that if the time field is empty then show one value; if the time field has data then show the other value) - then sort your portal using this field as well as the time field.

Posted

To get the longest time at the top, you'd have to sort descending, and that would never get the empties at the top.  Or am I missing something?

Thanks Wim! I don't think i explained my self too well! So lets say i have some people, and they each have the number of days since i've spoken to them:

 

John       5

James    2

Henry     100 

Fred       blank (have never spoken to)

 

 

if i sort Ascending, the files come up like this:

 

Fred

James    2

John      5

Henry    100

 

 

What i actually want is

 

 

James    2

John      5

Henry    100

Fred

 

 

 

 

 

perhaps you could create another field that would start out with a particular value - not having spoken to them, then would change to another value when you do speak to them (this could be a calc that if the time field is empty then show one value; if the time field has data then show the other value) - then sort your portal using this field as well as the time field.

 

 

Yes, this was the idea that i had. If (blank ; 100,000 ; time_since)

Then my sorting comes out as 

 

 

 

James    2

John      5

Henry    100

Fred      1000,000

 

which isn't too cool! It's ok, but it looks stupid.

 

As in the link that from my first post, filemaker say: 

 

Records with nothing in the sort field sort to the top of the list in an ascending sort. 
 
But it'd be great if i could switch it around.
Any ideas?
 
Cheers
Posted

that's not exactly what I meant - what I mean is to create a SECOND field that would show a value if you had talked to them and some other value if you had not talked to them - perhaps 'A' if you had talked to them and 'B' if you had not talked to them - then sort with BOTH fields - sort FIRST on the calc sort field if you had talked to them or not - so that all those who had been talked to would show up first (since they had 'A' in that field)  and THEN by the # of days field (ascending) this should give you a list like:

 

James    2  (A)

John      8   (A)

Paul     15   (A)

Mike           (B )

 

you wouldn't have to actually show the (A), (B ) calc sort field, of course.....

Posted

create a SECOND field that would show a value if you had talked to them and some other value if you had not talked to them

 

you wouldn't have to actually show the (A), (B ) calc sort field, of course.....

 

 

Ahh, i like your thinking!

 

it's the bit about not showing the fields that is the bit i didn't know about - that's great and means that i don't have to adjust anything in the display.

 

Works a treat - many thanks

This topic is 4298 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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