0

Displaying number of records in a sub table on each record

Hi there, I'm new here. I'm backing a database to store sales for my company. I have a table for new orders which has a sub table which is where I add the items to the invoice. I then want a formula to add up how many lines there are in this sub table (but only the ones appearing on this particular order). I use sum(Items.Product) which is returning a random number from nowhere. I thought this would be really easy and I'm sure it would be, im just stumped. Thanks in advance for the help

3 replies

null
    • Choices_Software_Dean
    • 3 yrs ago
    • Reported - view

    Click the wrench on the right to turn it red. Click a column header. Make your selection(s), click wrench on the right again to save your changes. This works both on the default table list and on views on a form that display related tables. Be sure to always use the wrench, if you want your changes saved.

    • Ninox partner
    • RoSoft_Steven.1
    • 3 yrs ago
    • Reported - view

    Hey Chris & James,

    You can use this in a formula field to show how many lines there are in your subtable of that particular record:

    let me := this;
    cnt(select Items where Order = me)

    In this example 'Order' is the tablename of your mastertable and 'Items' the name of the subtable.

    You can also use the footer of the subtable to show the amount of lines. To do so, use the red wrench, click on ID table header and chose Count to show the amount (#) of lines in your subtable.

     

    Steven

    • hey
    • 3 yrs ago
    • Reported - view

    Many thanks :)

Content aside

  • 3 yrs agoLast active
  • 3Replies
  • 701Views