How do I...?

Count the number of child records with specific data in a field

I have child records with "Available" as a field. I want to count the number of records that contain "Yes" in that field and ignore the rest.

1 vote
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
John Hubbard shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

2 comments

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...
  • Witte commented  ·   ·  Flag as inappropriate

    Just to clarify John, you would actually want use the sum() function to count these values, not the count() function I mentioned in my original response. This is because the count() function will count all of the values, both the "1"s and the "0"s. Instead, we want to sum those numbers, which will give us the accurate of records with "1" marked.

    My apologies on the confusion. Please let me know if I can provide any additional clarity.

  • Witte commented  ·   ·  Flag as inappropriate

    Hello John,

    To achieve this, you would want to create a new calculated text field on the child table use to mark records as being "Available" or not. You could use the following syntax:

    if({Field} = "Available", "1", "0")

    This formula will look to your preexisting field and returned a "1" if the value in that field is "Available". If not, it will returned a "0". Then, from the parent table, you can reference that newly created child field using the count() function to count the number of records that have been marked with a "1".

    I hope this is helpful. If you have any questions or need further assistance implementing this, please don't hesitate to reach out to our Support Team at 800-673-3302 or support@trackvia.com.

    Witte

Feedback and Knowledge Base