1 Reply Latest reply: Aug 5, 2015 3:07 PM by Sasidhar Parupudi RSS

    sum() with several parameters from different sources

      Hi guys,

      can you tell me: is it possible to sum(amount) with several parameters, with are from different sources?

      like this:

       

      Sales:

      Load EntryNo as Key1,

           DocNo,

           Date,

           Amount,

           GlobalDim1,

           GlobalDim2

      SQL SELECT* FROM X;

       

      SalesPerson:

      Load EntryNo as Key1,

           DimCode,

           DimCodeValue as Salesperson

           WHERE MATCH(DimCode,'Salesperson')

      SQL SELECT * FROM Y;

       

      SUM1:

      Load DocNo,

           'DirectSales-AA' as SalesGroup,

           sum(Amount) as SUMSUM Resident Sales (AND RESIDENT Sales ?) Where (GlobalDim1<=500 AND GlobalDim1>=400) AND Match(Salesperson,'AA')


      How I formulate like in SUM1 ?

      thank you

        • Re: sum() with several parameters from different sources
          Sasidhar Parupudi

          Try like this

          Sales:

           

          Load EntryNo as Key1,

               DocNo,

               Date,

               Amount,

               GlobalDim1,

               GlobalDim2;

          SQL SELECT* FROM X;

           

           

           

          left Join(Sales)

           

          Load EntryNo as Key1,

               DimCode,

               DimCodeValue as Salesperson

               WHERE MATCH(DimCode,'Salesperson');

          SQL SELECT * FROM Y;

           

           

          NoConcatenate

           

          SUM1:

          Load DocNo,

               'DirectSales-AA' as SalesGroup,

               sum(Amount) as TotalAmount

               Resident Sales

               where (GlobalDim1<=500 AND GlobalDim1>=400) AND Match(Salesperson,'AA')

               group by DocNo,'DirectSales-AA';