dbTalk Databases Forums  

Portal Sorting

comp.databases.filemaker comp.databases.filemaker


Discuss Portal Sorting in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Daniel G. Emilio
 
Posts: n/a

Default Portal Sorting - 10-08-2003 , 01:00 PM






I have a situation where I want to sort a portal first by date
ascending and then have a second portal of the same information that
is sorted by date descending. Can this be done?

Reply With Quote
  #2  
Old   
Lou Lesko
 
Posts: n/a

Default Re: Portal Sorting - 10-08-2003 , 02:46 PM






danielemilio (AT) earthlink (DOT) net (Daniel G. Emilio) writes:

Quote:
I have a situation where I want to sort a portal first by date
ascending and then have a second portal of the same information that
is sorted by date descending. Can this be done?
Did you even try before posting your question??? Even a novice attempt
would reveal that you can.

Make two relationships, and have one sort ascending and the second sort
descending and place them both on the layout.

loulou


Reply With Quote
  #3  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Portal Sorting - 10-08-2003 , 03:11 PM



In article <fdd71043.0310081000.e528ebb (AT) posting (DOT) google.com>,
danielemilio (AT) earthlink (DOT) net (Daniel G. Emilio) wrote:

Quote:
I have a situation where I want to sort a portal first by date
ascending and then have a second portal of the same information that
is sorted by date descending. Can this be done?
Sort order is set by the Relationship window, so simply create two
relationships then you can use two portals and make sure the fields in
those portals are using the correct relationship.

NOTE: be careful using portal/field script steps on layouts with more
than one portal - you need to make sure you're in the portal you want
first, ie. Go To Field [RelationNeeded::Field].

Helpful Harry
"Just trying to help whenever I can." )


Reply With Quote
  #4  
Old   
Bridget Eley
 
Posts: n/a

Default Re: Portal Sorting - 10-08-2003 , 03:54 PM



You don't need two portals. You can do this with one portal, a simple calc
and a simple scripted button.

Calc (date result) = If(gNumber = 1, Date(1, 1, 3000) - Date, Date)

(where gNumber = global number field)

The Date function nested within the If function simply subtracts the date
from a date that is larger than any date you will ever use. Can you guess
why? Can you see where I am going with this? If all dates in the portal
are subtracted from the same VERY LARGE DATE, and if the relationship is
sorted by this field, the results will reverse the previous order of the
records, according to whichever of the ascending or descending sort options
have been selected for the relationship.

All that remains to be done is to created a scripted button to toggle the
value in the global field between 1 and nothing:

Set Field [ gNumber, If(IsEmpty(gNumber), 1, "") ]
Set Field [ match field, match field ]

The second Set Field sets the current record match field for the portal
relationship to itself, updating the relationship.

Bridget Eley





in article fdd71043.0310081000.e528ebb (AT) pos...OT) google.com, Daniel G. Emilio
at danielemilio (AT) earthlink (DOT) net wrote on 9/10/03 4:00 AM:

Quote:
I have a situation where I want to sort a portal first by date
ascending and then have a second portal of the same information that
is sorted by date descending. Can this be done?
--

(to email direct, replace "DOT" with "." and remove ".invalid")



Reply With Quote
  #5  
Old   
Ursus
 
Posts: n/a

Default Re: portal sorting - 06-10-2007 , 04:38 AM



You rank them manualy?

Ursus

"Old Foggy" <OldFoggy (AT) Foggy (DOT) com> schreef in bericht
news:466baeeb$0$12793$9a6e19ea (AT) unlimited (DOT) newshosting.com...
Quote:
I had situations where I have prelimary results and will be getting more
results
over a span of sometimes months. Not being sure of where the new info will
rank
I start of by ranking the results in units of tens and in a few large
projects even units of 100's. Then with an educated guess place new info
somewhere in between the units
as needed.

Gus





Reply With Quote
  #6  
Old   
CRC123
 
Posts: n/a

Default Re: portal sorting - 06-10-2007 , 09:25 AM



On Jun 10, 2:38 am, "Ursus" <ursus.k... (AT) wanadoo (DOT) nl> wrote:
Quote:
You rank them manualy?

Ursus

"Old Foggy" <OldFo... (AT) Foggy (DOT) com> schreef in berichtnews:466baeeb$0$12793$9a6e19ea (AT) unlimited (DOT) newshosting.com...

I had situations where I have prelimary results and will be getting more
results
over a span of sometimes months. Not being sure of where the new info will
rank
I start of by ranking the results in units of tens and in a few large
projects even units of 100's. Then with an educated guess place new info
somewhere in between the units
as needed.

Gus
Wouldn't it make sense to create a field for the date the architect
contributed and rank on that directly (or indirectly if you require a
1, 2, 3,...scale)?

DKS



Reply With Quote
  #7  
Old   
Ursus
 
Posts: n/a

Default Re: portal sorting - 06-12-2007 , 02:59 AM



Quote:
Its been quite a while since I did this; and it was always slightly
cumbersome:

select a portal row to have the new architect come after (S) ie new
ranking
grab the portal row record sort number (to global or variable)
go to last row
set sort to sort +1
loop backwards incrementing the sort value by on for each record, until
sort value = S, this is the escaper time. There should now be a gap in
the sequence:
then parse the gap 'value' to the new architect


S-1
S
gap
S+1
S+2...

Thanks Chris, And how about getting a new entry on the first place (or a
first entry, no previous existing). Did you have a separate button for this?

Ursus




Reply With Quote
  #8  
Old   
Chris Brown
 
Posts: n/a

Default Re: portal sorting - 06-12-2007 , 06:38 PM



Ursus wrote:
Quote:
Its been quite a while since I did this; and it was always slightly
cumbersome:

select a portal row to have the new architect come after (S) ie new
ranking
grab the portal row record sort number (to global or variable)
go to last row
set sort to sort +1
loop backwards incrementing the sort value by on for each record, until
sort value = S, this is the escaper time. There should now be a gap in
the sequence:
then parse the gap 'value' to the new architect


S-1
S
gap
S+1
S+2...


Thanks Chris, And how about getting a new entry on the first place (or a
first entry, no previous existing). Did you have a separate button for this?

Ursus



Hi Ursus,

I was usually working with a portal of usually existing records and
shuffling the sort order . Creating the records was the usual button
driven process (prefer not to use direct portal entry). I reshuffled
after creation as I recall.

Creating a new record and nominating where it should slot in the
sequence is perhaps your situation.

The process probably needs to be 2 stage:

create a new (related) record; this does not necessarily have to have a
sort value; this way one can have 2 groups; the important with a a sort
sequence, and the less important with no sort value. The small problem
is that the non valued will sort ascending before those with a sort
value. So the sort value could be auto entered with 100 to effect
sorting last.

(The alternate with two groups, sort value/no sort value, is that you
could filter the portal with a global switch: sorted, unsorted, All.)

This auto enter (or scripted) value 100, can also act as a target
value for the resort script (if only one record has value 100), if all
records are to have a sequential sort value). Meaning once the record is
created, the user doesn't have to nominate which record they want to
place where, only where they want to place the new record.

Stage 2, resort; nominate the row for the new record to come after, then
resort script.

For a normal user situation, rather than ourselves, I would us the same
script for resort to:
click button RESORT:
script tests for $$_Target value; if $$_Target= ""
show message: please select a row for the new record/unsorted record to
follow, then click this button again
end script

user clicks row
row attached select script parses row number to $$_variable (and
establishes a row hilite...)

user clicks button: RESORT
script tests for $$_Target value , which now there is
does the resort, using sort value =100 as the record to move
clear $$_TARGET



there will be some juggling to integrate the 2 requirements of sorting
existing record, and resorting a for a new record. All do-able.



regards


Chris


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.