1 Reply Latest reply: Dec 5, 2014 6:03 PM by Manish Kachhia RSS

    Aggregate function invalid

    Cameron Scully

      I've been getting "invalid expression" errors on all my aggregation functions in a qlikview document and can't figure out why. Here are a couple examples that are not working. I can't seem to figure out where the synatx is wrong

       

      t_AggregateReciept:

      LOAD

          PO_line_key,

          sum(num(FreightCharges)) as FreightCharges

      Resident t_Reciept

      Group By PO_line_key;

       

      left join(OpenOrder)

      LOAD

        OrderLineKey,

        POnumber,

        POLineDueDate,

        max(POnumber) as test

      Resident POLink

      group by OrderLineKey;

       

      EDIT:

      Thanks for the solution. All fields must be grouped by or aggregated upon

       

      Message was edited by: Cameron Scully

        • Re: Aggregate function invalid
          Manish Kachhia

          t_AggregateReciept:

          LOAD

              PO_line_key,

              sum(num(FreightCharges)) as FreightCharges

          Resident t_Reciept

          Group By PO_line_key;

           

          left join(OpenOrder)

          LOAD

            OrderLineKey,

            POnumber,

            POLineDueDate,

            max(POnumber) as test

          Resident POLink

          group by OrderLineKey,POnumber,POLineDueDate;