4 Replies Latest reply: Apr 27, 2018 7:38 AM by Ruben Marin RSS

    mode of quantity

    Keti Kvirikashvili

      Hello,

       

      I have a table where I count The sum of quantity using variables ( min and max quantity, min and max visit)

       

      I use this formula

       

      Sum(

      aggr(

       

      If(


      ((Sum(Quantity) >= $(MinVisit) and Sum(Transaction) < $(MaxVisit)) and (Sum(Quantity) >= $(MinQuantity) and Sum(Quantity) < $(MaxQuantity)))


      ,  Quantity )

      ,SalesID)

      )


      I want to calculate the mode of quantity--- mode(Quantity)  but when I use the variables it should change appropriately


        • Re: mode of quantity
          Sunny Talwar

          Are you checking both MinVisit variable against Sum(Quantity) or should that be Sum(Transaction)??

           

          Sum(

          aggr(

           

          If(

           

          ((Sum(Quantity) >= $(MinVisit) and Sum(Transaction) < $(MaxVisit)) and (Sum(Quantity) >= $(MinQuantity) and Sum(Quantity) < $(MaxQuantity)))

           

          ,  Quantity )

          ,SalesID)

          )


          what exactly do you mean by this? Can you elaborate with an example?

          "I want to calculate the mode of quantity--- mode(Quantity)  but when I use the variables it should change appropriately"

          • Re: mode of quantity
            Ruben Marin

            Hi, I'm not sure to understand, if you change Sum to Mode it doesn't works?

            Mode(

            aggr(

             

            If(


            ((Sum(Quantity) >= $(MinVisit) and Sum(Transaction) < $(MaxVisit)) and (Sum(Quantity) >= $(MinQuantity) and Sum(Quantity) < $(MaxQuantity)))


            ,  Quantity )

            ,SalesID)

            )