OzzieOzzum Posted October 23, 2013 Posted October 23, 2013 I have a list of records in a table (CONDITIONS) shown on a list view. One of the fields is a checkbox when checked sets a value "Yes" to the field. I needed a calculation that shows the number of records flagged. What I tried: List of Records shown are based on a TO (Layout_Conditions) A field called "Flag" in each record is displayed as a checkbox to set a value "Yes" Created another TO based on CONDITIONS base table and named it "showCount_ofChecked" Created a global field gCheckedState and set it to "Yes" Created a self relationship between Layout_Conditions::gCheckedState and showCount_ofChecked::Flag Created a calculation field cCount_ofCheckedRecords(global, calculation, NumberResult) to count(showCount_ofChecked::Flag) from the context of Layout_Contacts But it does not work. cCount_ofCheckedRecords is always 1 whether one or several records are flagged. Any suggestions how to fix this. Thanks
comment Posted October 23, 2013 Posted October 23, 2013 Why don't you simply use a summary field, defined as Count of [Flag]? This will work for both the found set and - if you prefer - across a relationship. --- BTW, a smarter way to use a flag field is to make it a Number field and attach a value list of "1" instead of "Yes".
OzzieOzzum Posted October 23, 2013 Author Posted October 23, 2013 Why don't you simply use a summary field, defined as Count of [Flag]? This will work for both the found set and - if you prefer - across a relationship. --- BTW, a smarter way to use a flag field is to make it a Number field and attach a value list of "1" instead of "Yes". When I used the Count of [Flag] summary field, I got the magic number 17 all the time ?! Couldn't figure out where that came from. Thanks for pointing out to use number 1 instead of "Yes". Flipping the Flag is much easier now.
comment Posted October 23, 2013 Posted October 23, 2013 When I used the Count of [Flag] summary field, I got the magic number 17 all the time ?! Couldn't figure out where that came from. Depends on where you used it (i.e. in which context). Do you want to count the number of flagged records in the current found set, or the number of flagged records in the entire table?
OzzieOzzum Posted October 23, 2013 Author Posted October 23, 2013 Yes ! Thank you. It reports the correct result in the current found set. That is when I do a find in List view and flag records, it works fine. But what I need is the number of flagged records in the entire table. I tried Running count, it --kinda-- works. I use a script attached to an invisible rectangle of height 44pixels to flip the flag (for use on an ipad) The dataviewer shows the correct count when clicking and holding the mouse but the result reverts to 1 on releasing the mouse ??
comment Posted October 23, 2013 Posted October 23, 2013 But what I need is the number of flagged records in the entire table. Then you'll need to count across a relationship. There's probably a simpler method to arrange this than what you have described in your opening post, but I'd like to stick with for the moment because AFAICT it should work - see the attached file. CountStatus.fp7.zip If it doesn't, you must either have another thing going on in there or I have misread your description (it is kind of difficult to read).
OzzieOzzum Posted October 23, 2013 Author Posted October 23, 2013 Thank you so much. When I tried using the summary field using the self relationship it works.
Recommended Posts
This topic is 4419 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