dbTalk Databases Forums  

Converting text strings in numbers (count)

comp.databases.filemaker comp.databases.filemaker


Discuss Converting text strings in numbers (count) in the comp.databases.filemaker forum.



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

Default Converting text strings in numbers (count) - 05-08-2007 , 12:38 PM






Hi,

Here it is the problem: I have a text field with some categories (let
us say apples oranges and lemons) all those three categories are
repeated many times in the DB (Filemaker 8.5 adv. Win XP). Is there a
way to create another variable that report how many records are in the
"apples" category, how many in the "oranges" category and so on. Put
in other words, is there a way to store the frequency of each category
in another field, as number ?

I think should be easily done but a quick search through the functions
could not help me to figure it out.

Thank you always

Diego


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

Default Re: Converting text strings in numbers (count) - 05-09-2007 , 01:42 AM






In article <1178645914.353333.283290 (AT) p77g2000hsh (DOT) googlegroups.com>,
Diego B <messadua (AT) yahoo (DOT) it> wrote:

Quote:
Hi,

Here it is the problem: I have a text field with some categories (let
us say apples oranges and lemons) all those three categories are
repeated many times in the DB (Filemaker 8.5 adv. Win XP). Is there a
way to create another variable that report how many records are in the
"apples" category, how many in the "oranges" category and so on. Put
in other words, is there a way to store the frequency of each category
in another field, as number ?

I think should be easily done but a quick search through the functions
could not help me to figure it out.

Thank you always

Diego
That depends on what you want to do with that number.

For use on a printed report (or viewing in Preview mode) then having a
Summary field counting the records will work.
eg.
CategoryCount Summary
Count of Category

Put this field in a Sub-summary by Category Part of a Layout something
like:

[Category]

Body
------------

Count of [Category] is [CategoryCount]

Sub-summary by Category (Trailing)
------------

where [] denote the fields (or even Merge fields).

Now all you have to do is Find the records you want summarised, sort
them by the Category field, and then print or Preview this Layout.



If on the other hand you want an on-screen number displayed then it
really depends on whether you want the number of records with the same
category as the current record, or the number of all the categories.
ie.
The number of "apple" records when the current record is "Apple"

OR

Apples: 15 Oranges: 12 Bananas: 9


But having on-screen counters like this can cause databases with LOTS
of records to be slow since they have to keep counting the records.

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


Reply With Quote
  #3  
Old   
Diego B
 
Posts: n/a

Default Re: Converting text strings in numbers (count) - 05-09-2007 , 09:31 AM




Quote:
That depends on what you want to do with that number.

-------------Cut--------------------

Thank you Harry !

I solved the problem with a summary field (there are so many things
that I do not know about FM yet...)

But it turned out another weird problem (apparently) unrelated with
the first one:

I would like to draw a graph Pie starting from the summary field I
defined and everything works fine. The problem is that
I need a global Text field where to define the settings of the Pie.
Well everything goes right till FM remains on, but as soon as
I close and re-open it, the global field I had defined appears empty.
The weird thing is that the same field (I mean a field with the same
characteristics)
I use in another layout for another type of graph ( a line graph) does
not have this problem. Only the global field in the first layout gets
empty at the
restarting of FM, and I have no idea of the reason. Now I am forced to
paste the settings of the graph every time I restart FM and this is
too tedious.

Anyone has an idea on the possible reason ??


Diego



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

Default Re: Converting text strings in numbers (count) - 05-09-2007 , 03:35 PM



In article <1178721066.804067.319170 (AT) y80g2000hsf (DOT) googlegroups.com>,
Diego B <messadua (AT) yahoo (DOT) it> wrote:

Quote:
That depends on what you want to do with that number.

-------------Cut--------------------

Thank you Harry !

I solved the problem with a summary field (there are so many things
that I do not know about FM yet...)

But it turned out another weird problem (apparently) unrelated with
the first one:

I would like to draw a graph Pie starting from the summary field I
defined and everything works fine. The problem is that
I need a global Text field where to define the settings of the Pie.
Well everything goes right till FM remains on, but as soon as
I close and re-open it, the global field I had defined appears empty.
The weird thing is that the same field (I mean a field with the same
characteristics)
I use in another layout for another type of graph ( a line graph) does
not have this problem. Only the global field in the first layout gets
empty at the
restarting of FM, and I have no idea of the reason. Now I am forced to
paste the settings of the graph every time I restart FM and this is
too tedious.

Anyone has an idea on the possible reason ??
When a FileMaker database is stored on another computer and you are
accessing it via the network (either using a server version of
FileMaker or connecting to the database being hosted on another
computer), then the user changes to Global fields are not saved. Only
the host computer itself will save the changes it makes to of Global
fields when it quits. When a user connects to a hosted database they
are given a COPY of the Global field and it's data, which then becomes
a "local Global" that only affects them. If you want the data to stay
you will have to change it on the computer that is hosting the file -
and in the case of FileMaker server that may mean shutting the server
down, editing the FileMaker file in normal FileMaker and then
re-starting the server.

Another possibility is that there is a script being run (possibly when
closing the file) that is emptying the field for some reason.

A less likely possibility is that the hard disk or FileMaker file is
corrupted and FileMaker is not saving data properly.









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


Reply With Quote
  #5  
Old   
Diego B
 
Posts: n/a

Default Re: Converting text strings in numbers (count) - 05-09-2007 , 07:20 PM



On May 9, 3:35 pm, Helpful Harry <helpful_ha... (AT) nom (DOT) de.plume.com>
wrote:
Quote:
In article <1178721066.804067.319... (AT) y80g2000hsf (DOT) googlegroups.com>,



When a FileMaker database is stored on another computer and you are
accessing it via the network (either using a server version of
FileMaker or connecting to the database being hosted on another
computer), then the user changes to Global fields are not saved. Only
the host computer itself will save the changes it makes to of Global
fields when it quits. When a user connects to a hosted database they
are given a COPY of the Global field and it's data, which then becomes
a "local Global" that only affects them. If you want the data to stay
you will have to change it on the computer that is hosting the file -
and in the case of FileMaker server that may mean shutting the server
down, editing the FileMaker file in normal FileMaker and then
re-starting the server.

This was the right answer : ) I work with Filemaker 8 server and I
changed the first global text field before
starting the server. That was why the first global field was a global-
global while the second one, created
on the client, was only a global-local field.

Thank you so much, I was going crazy !

Diego



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.