Jump to content

Counting from list field


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

Recommended Posts

  • Newbies

Hi all,

My problem is the following:

I have a field which is related to a list made of three items let's say "past", "actual" and "future".

I'd like to count the number of record where "Past" is selected, as well as the number of record where "actual" is selected etc...

Could someone help me ?

Thanks

Matteo

Link to comment
Share on other sites

  • Newbies

Sorry I just got my answer....

Create a field for each value (past, actual and future) and count using patterncount ( FieldList, "past").

Then display the total using a summary field = Total of (patternCount(...))

Sorry for disturbing...

Link to comment
Share on other sites

Never disturbing ... that's what Forums is for. :wink2:

If you create a summary field (number) of Count(checkboxField) then:

Create a columnar report with sub-totals. Select the checkbox field. Group by checkbox field and sort by the checkbox field. Let FM store the script for you because sort order is important. Delete the body of the report. Place the summary field in the leading part next to the checkbox field.

Perform a manual find thus:

"past"

New Find Request

"actual"

Perform Find []

Then modify your script so it looks like this:

Go To Layout [ new report ]

Enter Find Mode [ uncheck pause, check Restore ]

Sort [ Restore ; No dialog ]

Enter Preview Mode [ pause ]

Enter Browse Mode [ ]

Go To Layout [ original layout ]

When you leave Script Maker, select REPLACE to store this new find within your script. Now this report will do it all for you automatically and additional fields are unnecessary. Sometimes this is useful; sometimes you need a calc field to always display your results. :wink2:

The added benefit of reporting is that the checkbox fields don't have to be hard-coded. If you later add another category, you'll always be adding fields ... with Restored Find, you can simply modify your find requests. And this will adjust if you want to restrict by dates as well - just include them in your search criteria.

LaRetta

Link to comment
Share on other sites

This topic is 5743 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
 Share

×
×
  • Create New...

Important Information

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