9 Replies Latest reply: Jul 26, 2013 2:09 AM by Mubbasher Khaliq RSS

    Aggregation on two dimensions in expression

      Hi ,

       

      I have added one dimension to chart Products(Computers , Laptops)

       

      I have to calculate best price of any dealer within each product

       

      Sample data is

       

       

      Dealer_IDProductPrice
      1Computer200
      1Computer300
      3Computer400
      4Computer500
      5Computer600
      1Laptop300
      2Laptop400
      3Laptop500
      4Laptop600
      5Laptop700

       

      I have added Product as dimension on chart so my formula is

       

      Min({$<Product=,Dealer_ID=>}

      Aggr(

      Avg({$<Product=,Dealer_ID=>}TOTAL <Dealer_ID> Price)

      ,Dealer_ID)

      )

       

       

      So my expected result is 200 for computer and 300 for Laptop

      But it gives me 200(which is overall best price disregarding product dimension which I have added in chart) for Computer and 0 for Laptop

       

      Any help is really appreciated.