arvids Posted February 4, 2005 Posted February 4, 2005 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...
NFD Posted February 4, 2005 Posted February 4, 2005 Create Calc Field [ValueCount] = PatternCount ( ValueListItems ( Get(FileName); "YourField"); "
NFD Posted February 4, 2005 Posted February 4, 2005 Sorry, I should have said; Create Calc Field [ValueCount] = PatternCount ( ValueListItems ( Get(FileName); "Value List Using Your Field"); "
-Queue- Posted February 4, 2005 Posted February 4, 2005 Or ValueCount(ValueListItems( Get(FileName); "ClientNumberValueList" ))
arvids Posted February 4, 2005 Author Posted February 4, 2005 Thanks a lot for your suggestions (I think I understand how to implement it too). Great!
arvids Posted February 6, 2005 Author Posted February 6, 2005 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!
-Queue- Posted February 7, 2005 Posted February 7, 2005 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 );
Recommended Posts
This topic is 7297 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 accountSign in
Already have an account? Sign in here.
Sign In Now