Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Calculation for number of clients??

Featured Replies

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

Create Calc Field [ValueCount] = PatternCount ( ValueListItems ( Get(FileName); "YourField"); "

Sorry, I should have said;

Create Calc Field [ValueCount] = PatternCount ( ValueListItems ( Get(FileName); "Value List Using Your Field"); "

Or ValueCount(ValueListItems( Get(FileName); "ClientNumberValueList" ))

Better call, Thanks

  • Author

Thanks a lot for your suggestions (I think I understand how to implement it too).

Great!

  • Author

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!

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 );

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.