February 4, 200521 yr 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...
February 4, 200521 yr Create Calc Field [ValueCount] = PatternCount ( ValueListItems ( Get(FileName); "YourField"); "
February 4, 200521 yr Sorry, I should have said; Create Calc Field [ValueCount] = PatternCount ( ValueListItems ( Get(FileName); "Value List Using Your Field"); "
February 4, 200521 yr Author Thanks a lot for your suggestions (I think I understand how to implement it too). Great!
February 6, 200521 yr 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!
February 7, 200521 yr 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