Forum Discussion

ScottCote's avatar
ScottCote
Qrew Trainee
11 months ago

Counting Instances of a Number in a Table

Hi everyone - I'm hoping someone out there can help me out.  I have a table that contains a field, Estimate Number.  This Estimate Number repeats but is differentiated by another field, Version Number.  Here's a screenshot of a report that I think explains this better:


I need to create a field within this table that counts the number of estimates.  In the example above it would be 14.  I've tried creating a summary field but there aren't any tables that have the right level of aggregation and where this table is Child.

Thanks!



------------------------------
Scott Cote
------------------------------

3 Replies

  • Scott - did you try using a query field to count the number of records that match the estimate number?  That way if you have gaps in the version numbers - you'd get the right nr of estimates and you could expand it to look at other thinks like status, etc.  Yeah - you're counting in the same table, but that should be just fine. 



    ------------------------------
    joe vandervest
    ------------------------------
    • MarkShnier__You's avatar
      MarkShnier__You
      Qrew #1 Challenger

      Scott, try this as a formula numeric field.

      var text QUERY = 
        "{99.EX." & ToText([Estimate #]) & "}";

      Size(
      GetRecords($QUERY))

      // change the 99 to the field ID# of the [Estimate #]



      ------------------------------
      Mark Shnier (Your Quickbase Coach)
      mark.shnier@gmail.com
      ------------------------------
      • ScottCote's avatar
        ScottCote
        Qrew Trainee

        Hi Mark - thanks so much, that worked perfectly and solved my problem.

        Joe, I didn't know about the query function but now I do and this will be really helpful.

        I tried using Chat GPT to solve this before turning to the community.  AI couldn't figure it out (yet).




        ------------------------------
        Scott Cote
        ------------------------------