jim shelton Posted March 19, 2012 Posted March 19, 2012 In a script I have Set Variable for a list of scores. Example: 8 14 18 16 21 20 24 27 I am writing a loop to count the times a value occurs in the list. Then go to the next value. I tried PatternCount, but it counted 20 when I was looking for count of Value=0. $CurScore is the individual Value. PatternCount ( $List ;$CurScore & "¶") thanks, Jim
LaRetta Posted March 19, 2012 Posted March 19, 2012 Try this: PatternCount ( ¶ & $List & ¶ ;¶ & $CurScore & ¶ )
comment Posted March 19, 2012 Posted March 19, 2012 Or = ValueCount ( FilterValues ( listOfValues ; item ) ) I am writing a loop to count the times a value occurs in the list. Then go to the next value. Why won't you use a table to hold your values, then summarize the records using a summary field?
imoree Posted March 19, 2012 Posted March 19, 2012 Or = ValueCount ( FilterValues ( listOfValues ; item ) ) Why won't you use a table to hold your values, then summarize the records using a summary field? The Question to you Comment would be Why would you? _ At least that is my question. I know your fav function is filtervalues( ) _ it is becoming mine as well. -i
imoree Posted March 19, 2012 Posted March 19, 2012 eg= Show me the Value Count ( how many ) Times "Bryan" is in the list. ValueCount ( FilterValues ( List ( BaseTable::FirstName); "Bryan")
comment Posted March 19, 2012 Posted March 19, 2012 The Question to you Comment would be Why would you? Why would I what?
imoree Posted March 19, 2012 Posted March 19, 2012 Why would I what? Answer the question: Why won't you use a table to hold your values, then summarize the records using a summary field? _ I am asking you wy would you use a table to hold your values and then summarize the records using a summary field? -thanks
comment Posted March 20, 2012 Posted March 20, 2012 Because that's how a database application is designed to handle data: structured into records and fields. Otherwise why wouldn't you put ALL your data into a single global field, and deal with it through looping scripts and what have you? Here the question is how many times does each value appear in the list - and Filemaker already has the mechanism to handle this by sorting the records by value and showing the count in a summary field placed in a sub-summary part.
imoree Posted March 20, 2012 Posted March 20, 2012 Thank you. Now Perhaps Jim Shelton can use this information to further understand this feature / use just as i do now.. I think thinking logicaly such as a structured database is hard to comprehend for some of us because we are thinking quick fix or code something rather than just use simplicity techniques as you recommend all too often. UNDERSTANDING Data structure is the absolute most important think i am learning by using FIlemaker, Albeit annoying at times. : )
Recommended Posts
This topic is 4976 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