==================
Average Formula Test
==================

table 50100 "CalcFormula Test"
{
    fields
    {
        field(1; "Average Example"; Decimal)
        {
            FieldClass = FlowField;
            CalcFormula = average("Sales Line".Amount where("Document Type" = field("No.")));
        }
    }
}

---

(source_file
  (table_declaration
    (table_keyword)
    (integer)
    (quoted_identifier)
    (fields_section
      (fields_keyword)
      (field_declaration
        (integer)
        (quoted_identifier)
        (type_specification
          (basic_type))
        (property
          (property_name)
          (identifier))
        (property
          (property_name)
          (aggregate_formula
            (aggregate_function)
            (calc_field_reference
              (quoted_identifier)
              (identifier))
            (where_clause
              (where_conditions
                (where_condition
                  (quoted_identifier)
                  (quoted_identifier))))))))))
