Jump to content

Calculation for number of clients??


This topic is 7016 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Is it possible to use a calculation, to return the number of non-identical posts based on one field.

To explain what I mean, I have a db with posts relating to clients. Every post have a client number, and in the cases where a client have multiple posts, that client number will be used over and over again.

I do need to know how many clients are in the DB, but not how many posts. So let's say this is the db:

_________________

Posts Clients

4 North

1 Smith

9 Roberts

__________________

Here I want the number 3, to reflect that there are 3 clients. Can I get that? How?

Regards

arvids

I wanted to search for an answer to my question, but could not define a search in a useful way... confused.gif

Link to comment
Share on other sites

Hey, this seem to work fine, all though I could not use the "get(filename)" parameter in the calculation(?), and as a hint to others - put the indexing to recalculate (I can't remember the correct wording in the English version)

Anyhow... would it be possible to have the resulting client numbers (from the value list) generate posts in another DB. I mean, only one post per client number?

Thanks!

Link to comment
Share on other sites

FM7 uses Get functions, which are equivalent to Status functions in previous versions, though I'm not sure what the equivalent would be for your language settings. The unstored option is 'do not store calculation results'.

You could loop through the value list and create a new record for each line. Something like

Freeze Window

Go to Layout [{layout associated with TO in which you wish to create new records}]

Show All Records

Show Omitted Only

Loop

Exit Loop If [not Get(FoundCount)]

Omit Record

End Loop

Loop

New Record/Request

Set Field [Client ID; Substitute( MiddleValues( ValueListItems( Get(FileName); "ClientNumberValueList" ); Get(RecordNumber); 1 );

Link to comment
Share on other sites

This topic is 7016 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.