Jump to content

Count Occurrences of Value within a List


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

Recommended Posts

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

: )

Link to comment
Share on other sites

This topic is 4414 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.