3 Replies Latest reply: Aug 19, 2016 7:41 AM by RAM MUTHIAH M RSS

    Sum & group by in load from resident table

    fredrik olsson

      Hi,

       

      ProductCodeProductDescriptionProductPriceProductUnitsProductCurrency
      AVBInsurance for Karl1501SEK
      AVBInsurance for Hanna751SEK
      KONBicycle5002SEK

       

      I have a Product table with data that are loaded to my app, but now I wanna use the data in the load script for other calculations and need to know how many ProductUnits I have for every ProductCode. I'm trying to something like this but only get invalid expression:

       

      Any help are appreciated

       

      TMPPRODUCT:

      NOCONCATENATE

      LOAD SUM(ProductUnits) as ProductUnits, ProductCode, ProductDescription, ProductPrice, ProductCurrency RESIDENT Product WHERE MATCH(ProductCode, 'AVB', 'KON', 'KRED') GROUP BY ProductCode;