Forum Discussion

JanetPlumley's avatar
JanetPlumley
Qrew Cadet
6 years ago
Solved

Limit the summary text records to the most recent 3 child records

When I am creating a summary text field on my parent table, is there a way that I can limit the child records to the most recent 3 records?

Parent (Invoices) -> Child (comments)
We only want to see the 3 most recent comments in the summary field.
  • If you're referring to the new combined-text summary field; then you need to first identify what the 3 most recent child-table records are.  You can do that with the following:

    1.  Summary field between Invoices < Child called [Maximum Record ID#] where you are pulling the Maximum [Record ID#] value

    2.  Lookup field to Child table [Maximum Record ID#]

    3.  Summary field between Invoices < Child [2nd Maximum Record ID#] = Max Record ID# where [Record ID#] is NOT equal to [Maximum Record ID#]

    4.  Lookup field to Child table [2nd Maximum Record ID#]

    5.  Summary field between Invoices < Child [3rd Maximum Record ID#] = Max Record ID# where [Record ID#] is NOT equal to [Maximum Record ID#] and [Record ID#] is NOT equal to [2nd Max Record ID#]

    6.  Lookup field to Child table [3rd Maximum Record ID#]

    7.  Formula field (checkbox)
         If([Record ID#] = [Maximum Record ID#] or [Record ID#] = [2nd Maximum Record ID#] or [Record ID#] = [3rd Maximum Record ID#], true, false)

    8.  Combined Text Summary Field:  Combine text where [Formula-Checkbox Field] = true.

    This way your combined Text will constantly change as your Child-Records update

    A more convoluted way to do this would be via reverse relationships; which would also be helpful depending on how you want to "view" these comments; in a combined text field; they will all be in a single-field separated.  Via 3 relationships they will be in separate fields.
  • If you're referring to the new combined-text summary field; then you need to first identify what the 3 most recent child-table records are.  You can do that with the following:

    1.  Summary field between Invoices < Child called [Maximum Record ID#] where you are pulling the Maximum [Record ID#] value

    2.  Lookup field to Child table [Maximum Record ID#]

    3.  Summary field between Invoices < Child [2nd Maximum Record ID#] = Max Record ID# where [Record ID#] is NOT equal to [Maximum Record ID#]

    4.  Lookup field to Child table [2nd Maximum Record ID#]

    5.  Summary field between Invoices < Child [3rd Maximum Record ID#] = Max Record ID# where [Record ID#] is NOT equal to [Maximum Record ID#] and [Record ID#] is NOT equal to [2nd Max Record ID#]

    6.  Lookup field to Child table [3rd Maximum Record ID#]

    7.  Formula field (checkbox)
         If([Record ID#] = [Maximum Record ID#] or [Record ID#] = [2nd Maximum Record ID#] or [Record ID#] = [3rd Maximum Record ID#], true, false)

    8.  Combined Text Summary Field:  Combine text where [Formula-Checkbox Field] = true.

    This way your combined Text will constantly change as your Child-Records update

    A more convoluted way to do this would be via reverse relationships; which would also be helpful depending on how you want to "view" these comments; in a combined text field; they will all be in a single-field separated.  Via 3 relationships they will be in separate fields.
    • GunshamLakhiani's avatar
      GunshamLakhiani
      Qrew Cadet
      Laura , I would like to thank you personally for this solution. It's superb and detailed . It was very helpful for me . 

      I would suggest an additional clarity for newbies like me .
      Step 7 In child's table make the following formula
      Step 8 On relationship page , add the following field in parent table and add the condition mentioned.

      ------------------------------
      Gunsham Lakhiani
      ------------------------------
    • MICHAELSARGENT's avatar
      MICHAELSARGENT
      Qrew Cadet
      Just came across this and it worked flawlessly.  A few notes on her process that might help:

      1. Step 7 is done on the child table
      2. The maximum record id field on the child table likely has the parent table's name in front (e.g. Projects - Maximum Record ID), based on when you added it as a lookup field in the table-to-table relationships. That's important when you then create the formula field in Step 7


      ------------------------------
      MICHAEL SARGENT
      ------------------------------
  • Yes, I am referring to the new combined text summary field. I am eager to try this out. Thanks for the step by step process!
  • QuickBasePros_IDS, Champion
    Your solution works great, thanks so much for the solution!!!!
  • If you embed a Report Link on a form, you can limit the Rows to display to whatever you like.


    This doesn't help you when the link displays in reports, unfortunately.
    • JanetPlumley's avatar
      JanetPlumley
      Qrew Cadet
      I don't think the user wants this information on a form. they want in a report. Thanks for the input! that is really great to know. if the report part does not work great, this could be another option for them.  Thanks!!!!