Jump to content
Kensg

total number of records in the found set and report

Recommended Posts

Kensg

Hi all,

I am a pretty new user to Filemaker pro ( version 7 ) and have a couple of questions about filemaker.

 

1. I want to setup a screen that let users to enter the beginning date and the ending date. After enterring, the report has only the records in this range. I try to do in the browse mode, but i couldnot get it. I tried to create to fields beginning date and ending date, but i get stuck after that. please advice.

 

2. My database has 1000 records. After i ran the find mode, my active database only has 815 records. My question is which command i could use to get total of found set records. I tried to use get(foundcount), it gave me 1000 or get(totalrecordcount), the answer was still 1000. Please advise.

 

Thanks in advance.

Regards,

Ken.

Share this post


Link to post
Share on other sites
Maarten Witberg
1. I want to setup a screen that let users to enter the beginning date and the ending date. After enterring, the report has only the records in this range. I try to do in the browse mode, but i couldnot get it. I tried to create to fields beginning date and ending date, but i get stuck after that. please advice.

 

BeginDate and EndDate should be global fields. Then script

 

show custom dialogue [#with the global fields as query fields#]

enter find mode

set field [YourTable::YourDatefield ; BeginDate&"..."&EndDate ]

perform find

 

But this is really skeleton like scripting. entry of dates is always fiddly, and there are many ways the search could go wrong because of sloppy data entry. so there'd have to be checks installed to ensure proper functioning. Or the dates should be concatenated from separate day, month and year fields. If needed I can put together a sample later today or tomorrow. Do the date ranges need to be exact to the day or could they be month to month?

 

2. My database has 1000 records. After i ran the find mode, my active database only has 815 records. My question is which command i could use to get total of found set records. I tried to use get(foundcount), it gave me 1000 or get(totalrecordcount), the answer was still 1000. Please advise

 

get(foundcount) should work fine as long it's in an unstored calculation; you could also make it a global number field and use the find script to set the found count

set field [gFoundSet;get(foundcount)]

 

kjoe

Share this post


Link to post
Share on other sites
Kensg

Hi Kjoe,

thanks for your advice, i am trying to follow your step, but somehow the answer is not correctly. I am trying to figure it out why. If possible, could you please put the sample for me to reference. I am very appricated.

I have one more question, in the certain field in the "found set", there are only to value " Yes" and "No". could i possible to count the total numbers of "Yes" records in the foundset not the "original set". Please advice.

thanks,

Kensg

Share this post


Link to post
Share on other sites
Kensg

Hi kjoe,

the day should be exact to the day ( not month to month).

i just got the correct answer. But if you don't mind, please put your example for my reference. I will be appreciated. Again, thanks for your helping.

 

thanks,

kensg

Share this post


Link to post
Share on other sites
Maarten Witberg

i just got the correct answer.

 

 

 

Hi Kensg

 

which of your two original questions is solved now?

I can make a sample tomorrow evening, not earlier. I'll post it as soon as possible.

I have one more question, in the certain field in the "found set", there are only to value " Yes" and "No". could i possible to count the total numbers of "Yes" records in the foundset not the "original set". Please advice.
I'll put an example how to count yes's in also.

 

maybe there's someone out there who has time sooner.

 

 

kjoe

Share this post


Link to post
Share on other sites
Kensg

Hi Kjoe,

I got both 2 answers are correct. yeah, you could put your example when you have time. Thanks for your helping.

I have another question: After i have a "foundset", there is a field only containes 2 values "yes" and "no", could i count the number of "yes"? please advice.

thanks,

Kensg

Share this post


Link to post
Share on other sites
Kensg

Hi Kjoe,

I got all the questions. I used constrain found set to find the "yes" records.

Thanks again.

Kensg

Share this post


Link to post
Share on other sites
Kensg

Hello,

Could someone tell me whether filemaker's scripts look like any language's scripts? what is it? I researched on internet, but i couldn't find any languages that look like filemaker's scripts.

thanks,

Khuong

Share this post


Link to post
Share on other sites
J Wenmeekers

Scriptmaker isn't a computer language like BASIC, Pascal or C++.

It is basically a macro generator.

It’s a sequence of steps that run in a linear fashion to automate a process that would otherwise be performed manually.

What you get with ScriptMaker, that you don’t get with other macro languages, is a dynamic environment.

Once finished, you can end up with many scripts that create a feature set.

One script can call another script, which can, in turn call yet another script.

Scripts can make logical decisions and perform repetitive tasks (looping)

 

Scripting is what makes a database solution equivalent to a piece of software.

So, in the truest sense, you are programming when creating functional scripts.

 

Using Scriptmaker adds a level of automation and sophistication to your database, making it significantly more powerful.

Sequencing the steps which perform finds and sort, adding repetitive controls and incorporating the power of decision making conditional statements, enable your database to do just about anything you can dream up.

By simply attaching the script to a button, the whole process becomes a one-click operation.

Share this post


Link to post
Share on other sites
Kensg

Thanks Wenmeekers.

Kensg

Share this post


Link to post
Share on other sites
Kensg

Hello all,

After running a find script, i have the result A, and use the constrain foundset to get the total number of records of the certain in the foundset that has the result " Yes" ( called it B). However, In my layout, i want to show the result A, so I need to do find script again. Is there anyway to run the find script only 1 time?

Ex:

After running the find script, the result (A):

Customer On-Time

Kensg

Share this post


Link to post
Share on other sites
Kensg

Hello all,

After running a find script, i have the result A, and use the constrain foundset to get the total number of records of the certain in the foundset that has the result " Yes" ( called it B). However, In my layout, i want to show the result A, so I need to run find script again. Is there anyway to run the find script only 1 time?

Ex:

After running the find script, the result (A):

Customer On-Time

Kensg Yes

Tran No

 

I want My layout

 

Number of records after run a find script: 2

Number of records on time: 1

Customer On Time

Kensg Yes

Tran No

 

My way is run a find script, then run a constrain to get number of records on times, and final run a find script again to appear the result A?

Is there any way to run a find script only 1 time to get the result? My data base is very large.

Thanks in advance.

Regards,

Kensg

Share this post


Link to post
Share on other sites
aaa

Hi, Kensg!

In this case i use Modify Last Find script - CTRL+R.

Share this post


Link to post
Share on other sites
Kensg

Hi aaa,

thanks for your advice, but it seems the modify last script doesn't work correctly (I did it before, i ran the findscript and the number of record is different from the modify last script) in my situation, and actually, the modify last script is also a "find" script. Do you have other advice?

Regards,

Kensg

Share this post


Link to post
Share on other sites
LaRetta

Your post is unclear. If you want to end up with the number of Customers On Time (which have a Yes in that field) then just use script of:

 

Perform Find [ Restore ]

 

... in Find Request select CustomerOnTime field and in box just type Yes (then Add).

 

BTW, I hope you don't truly have a dash in your field name. Customer On-Time is an invalid field name and FM would have warned you as well. Anyway, if this doesn't help you then you will need to provide more information. I have no idea what your first find is looking for and you need to be more specific and please don't use A and B and such ... it doesn't provide a visual of what you are doing. Pretend that you are explaining it to a new employee.

 

LaRettasmiley-smile

Share this post


Link to post
Share on other sites
Kensg

Hi LaRetta,

My table has the fields: Customerid, customerName, Shipdate, DueDate, Beggining day, Endingdate, Ontime, specificcustomerName, Ontime, FoundYes, found records, allcustomer.........................

-The Ontime field is Yes if DueDate>= Shipdate.

-SpecificcustomerName is used for specific customer report to get the name of customer. It's the global variable.

- FoundYes: total number of found yes

-Found record: total number of found record ( Ontime and not Ontime aswell)

- allcustomer field is only 2 values: AllCustomer or SpecificCustomer

-Begginingday and Endingdate are global as well.

My layout let users enter the Begging day and the ending day, also let user to choose b/t all customer or specific customer. After the users enter all the information, the report will appear like following:

 

- Total Number of records ( has shipping date b/t beginning date and endingdate):

- Total Number of shipping Ontime records ( has the shipping date b/t beginning date and endingdate and DueDate>=Shipdate):

- Show all Records ( Customer name, Shipdate, DueDate): have the Shipping date b/t Beginning date and Endingdate ( include ontime and not ontime shipping)

My script:

Enter Find Mode[]

SetFied[shipDate, Beginningdate &"..." &Endingdate]

 

if [allcustomer=Specificcustomer]

SetFied[Customername,SpecificcustomerName]

end

 

Perfrom Find

 

if [get(foundcount)=0]

...

else

set field [found records; get(foundcount)]

constrain found Set [Restore] //set ontime= "yes"

setField[foundYes, Get(foundcount)]

 

 

//to show total all records in the range, I need to run the find script again

 

Enter Find Mode[]

SetFied[shipDate, Beginningdate &"..." &Endingdate]

if [allcustomer=Specificcustomer]

SetFied[Customername,SpecificcustomerName]

end

Perfrom Find

go to Layout....

end

 

 

My questions:

1. Are there any way for me not to run the 2nd Find script because my database is large

2. When the allcustomer ="Specificcustomer" ( report only one specific customer), my script takes a lot of time ....about 15s.....to execute ( compare to allcustomer="AllCustomer"). Anyone know why?

 

Thanks,

regards,

Kensg

Share this post


Link to post
Share on other sites
aaa

Hi, Kensg! Why not relations?

I tried your goal by using relationships for 180000 records.

I recived answer for your questions about near 5 sec.

If you want i will attach my example.

Share this post


Link to post
Share on other sites
aaa

And now i tried it by finding. It works imidiatly.

Share this post


Link to post
Share on other sites
Kensg

Hi aaa,

Yes, please.

Thanks,

Kensg

Share this post


Link to post
Share on other sites
aaa
Hi aaa,

Yes, please.

Thanks,

Kensg

Hi, Kensg!

I attached example.

Here are two layouts:

First i did by relationships.

Second - by script.

There is script for adding records. I attached with 100 records, but i tried it for near 190000 records.

May be your finding fields is unstored calculation?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
×
  • Create New...

Important Information

Terms of Use