Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Running Count restart


Dimitri
 Share

Recommended Posts

I use Filemaker Pro 5.0 
I am struggling with running count for a specific value
What I want to do 

Each time I create a new record a specific number is given to that record (in my case a B number , for example B0100) 
I've put a running count on that field , so it increase by 1, 2, 3 etc ...
When I want to create a new record with B0101, I want that the running count is restarting with 1.

How is this possible in Filemaker 5.0 ? 

Link to comment
Share on other sites

I don't understand what you want it to do.  If the "B" number goes up by one for each new record, B0100 is immediately followed by B0101.  

If you have a separate field that is "running count", it would have a 1 in it if it started out with 0 for B0100.  It would have a 2 in it if it started out with 1 for B0100.  If you want it to start over with 1 after only making one record (from B0100 to B0101 sure looks like only one record), what would it ever be a running count OF??

 

 

Link to comment
Share on other sites

If I create a new record I give it a number (In my case B0100) , this number repeat for several records but need to have a running count per B0100. (B0100 / 1 , B0100 / 2 , B0100 / 3 , ... 

After the B0100 number is done (this number is used as a requestnumber and put in the FM database)
I want when I go to B0101 the running count starts over at 1  and counting (Running count) until I go to B0102 ... In other FM databases you can restart the running count. But in FM 5.0 I don't have this option. Does a specific calculation would support here?

Many thanks for your reply  

Link to comment
Share on other sites

The field that contains the B0100 or B0101 or whatever:  I am going to nickname it BNumber for purposes of this example.  

Make a selfjoin relationship of BNumber to BNumber.

 

 

282315437_RelationshipSelfjoin.jpg.0de86da521c1b5bc11c7cc34740b603a.jpg 

 

 

Now create a calc field defined simply as 1, let's name it One.  Now create a calcfield defined as Sum (SelfJoin::One)+1, and let's call it FetchCount.

Finally, define your Count field.  Set it to auto-enter the value 1, and then *also* set it to look up its value:  look up FetchCount from SelfJoin.

2066735927_AutoEnterOptionsforCount.jpg.090ca6bc0d0f4ac2663e71fa15b6e7f3.jpg

Result

 

B0101 (first record) Count = 1

B0101 (second record) Count = 2

B0101 (third record) Count = 3

B0102 (fourth record) Count = 1

etc

Link to comment
Share on other sites

Hi,

I've putted in FM 5.0. And it works ! <Super  thanks ! 😀😀😀
Can you advise me when I duplicate records, when I duplicate a record the Count don't change automaticaly... 

 

Many thanks 
 

image.png

image.png

image.png

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

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.

 Share



×
×
  • Create New...

Important Information

Terms of Use