2 Replies Latest reply: Aug 23, 2013 12:35 AM by Alejandro Hernandez RSS

    Why is qlikview summing rows by itself?

      I have a question I have this query:

       

      VentasXSalesPerson:

      SQL Select SOH.SalesPersonID as SalesPerson,sum(SOH.SubTotal) AS [VentaTotal] from Sales.SalesOrderHeader SOH

      inner join Sales.SalesPerson as SS on SS.SalesPersonID = SOH.SalesPersonID

      group by SOH.SalesPersonID;

       

      Productos:

      SQL SELECT  ass.[SalesOrderID]

            ,ass.[OrderQty]

            ,ass.[ProductID], pp.Name

        FROM [AdventureWorks].[Sales].[SalesOrderDetail] as  ass

        INNER JOIN Production.Product pp on  pp.ProductID = ass.ProductID;

       

      And I want to see how many products each sales person made and the amount, but this is what I got:

       

      Untitled.jpg

      As you can see the sales Person 268 sold different products for example: 742, 741 etc... but it's summing all of them,

      I attached the qv file so that you can help me.