dbTalk Databases Forums  

summary field

comp.databases.filemaker comp.databases.filemaker


Discuss summary field in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
jc@agncs.com
 
Posts: n/a

Default summary field - 03-08-2007 , 07:05 AM






I have a db that tracks floor traffic in a store. Every record that
is entered has a value of "1". So to get a glimpse of how many people
have been in the store today, I have a field that "(if "Todays record
date" = Get Current Date , 1,0) Next I have a summary field that
summarizes that field. So, everytime you go to that layout or open
the program it takes a long time for the database to summarize through
that many records.

Is there a better soltuion for doing this?
Fm 7.0


Thanks


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

Default Re: summary field - 03-09-2007 , 08:37 PM






In article <1173359159.258676.11090 (AT) 8g2000cwh (DOT) googlegroups.com>,
jc (AT) agncs (DOT) com wrote:

Quote:
I have a db that tracks floor traffic in a store. Every record that
is entered has a value of "1". So to get a glimpse of how many people
have been in the store today, I have a field that "(if "Todays record
date" = Get Current Date , 1,0) Next I have a summary field that
summarizes that field. So, everytime you go to that layout or open
the program it takes a long time for the database to summarize through
that many records.

Is there a better soltuion for doing this?
Fm 7.0
Do you really need to know how many people have been in the store as a
constantly updated on-screen number??

The cause of the slowness is the combination of the Calculation and the
Summary fields - both are probably being re-calculated every time you
change to a layout containing either of them.


Probably the best solution would be to delete the Calculation field so
that it isn't recalculating. Then change the Summary field to simply
Count any field that ALWAYS has data for every record (maybe the Date
field). Next move the Summary field onto a separate layout that isn't
used for anything else. Now whenever you want to know the number of
visitors you just perform a Find on today's date (or any date you want)
and then switch to the Summary field's layout - this could be scripted
and performed by a simple "Today's Visitors" button on any / all
layouts you want to put it on.

You can also use this same Summary field (on a new layout) to print out
a list of visitor numbers for any dates you want to Find.


If you do need a constant on-screen number then a Relationship is
probably a better approach (especially since Summary fields are better
used in Preview mode or printouts), would be to again delete the
Summary field. Define a new Global field of Date type, into this field
you can type any date (you can create an Opening Script via the
document's Preferences that automatically enters today's date). This
Global field can be used to define a Relationship to gather together
all the records with that particular date.
eg.
DateRelationship Same Table / File
when Global_Date = Record_Date

Now you can change the Calculation field to Count the records via this
relationship.
eg.
NumVistors = Count(DateRelationship::Record_Date)

You can put the two fields on any layout, and by typing any new date
into Global_Date the NumVisitors will update - it will be slow when
first changing dates, but not when you view the fields again.



Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


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.