dbTalk Databases Forums  

Filtering Portals

comp.databases.filemaker comp.databases.filemaker


Discuss Filtering Portals in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
JC
 
Posts: n/a

Default Filtering Portals - 01-13-2006 , 09:44 AM






Portals are driving me crazy. Is there a way to filter a portal by
"sales date" or "salesperson" on the fly. Or assuming I have the
talble "Sales" set up, what would be the proper relationship to set up
to show only records for a partiular sales period. Lets say the past
90 days. This is using FM 7

Thanks
JC LEwis


Reply With Quote
  #2  
Old   
Dan Fretwell
 
Posts: n/a

Default Re: Filtering Portals - 01-13-2006 , 11:34 AM






There are various ways of doing this depending on your needs. Let me
tackle the final part of your question. Make a new table Filter with a
global date field Date1, a global number field Days and a global Date
calculation Date2 = Date1 + Days.

In your relationship diagram relate Sales to Filter; Sales Date x
Date1 (relates all records to all records). Make a second ocurrence of
Sales call it SalesbyPeriod and relate Filter to SalesbyPeriod using
Date1 <= SalesDate (less or equal)
Date2 >= SalesDate (greater than or equal)

Put a portal into SalesbyPeriod in a layout based on the Sales TO and
drop into whatever fields you want. Also put onto the layour Date1 and
Days. As you put dates and day numbers in the portal contents will
reflect all the sales from Date1 and the next Days days.

If you want to look at Sales by Salesperson then add a global field for
Salesperson into the Filter table. Make a TO of Sales, call it
SalesbyPerson and relate it to the Filter table by matching
Salespersons ID.

These methods will produce the same portal contents in every record of
Sales. If you want to vary the portal according to the record you are
in then change the x relationship into something more restrictive.


Reply With Quote
  #3  
Old   
Dan Fretwell
 
Posts: n/a

Default Re: Filtering Portals - 01-13-2006 , 11:36 AM



Sorry, forgot to say - you need a record in the Filter table otherwise
it doesn't work.


Reply With Quote
  #4  
Old   
Grip
 
Posts: n/a

Default Re: Filtering Portals - 01-13-2006 , 11:48 AM



Create a global text field in the table Salesperson (or whichever one
you want to place the portal on): gYesNo, validate it with value list
YesNo = Yes No. Set it to "Yes".

Create a calc field in the table Sales:
calcNinetyDays = If(Get(CurrentDate) - SalesDate =< 90; Yes;No)

Create a relationship between gYesNo and calcNinetyDays.


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

Default Re: Filtering Portals - 01-13-2006 , 12:23 PM



Thanks to both of you. What is the equivalent in FM 7 from FM 6 of
GetFieldName(PortalField)

Thanks
JC


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

Default Re: Filtering Portals - 01-13-2006 , 01:47 PM



Dan:

I created the table "Filter" with the appropriate fields/

I related the table "Filter" to my "Sales Table" using
salestable:"sales date" x filter"date1

Then I related
filterate1< to salestable:sales date
Date2>= to salestable:sales date

I built a new layout showing records from "salestable"
I put a portal using "table26" which was the name of the occurence of
the last
relationship.

I put the two fields on you mentioned, but nothing showed up in the
portal.

what am I doing wrong?

Thanks
JC


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

Default Re: Filtering Portals - 01-13-2006 , 02:48 PM



Got IT!! I didn't add that record to the filter table.

thanks
jc


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 - 2013, Jelsoft Enterprises Ltd.