3 Replies Latest reply on Jul 6, 2018 8:59 AM by Deepak Rai

    How to, LOD for ratio of ratio

    jon rios

      i would like to find the % ratio of individual Weekday/ Category to (Category Totals ) as a single LOD formula.

       

      so for Technology&Sunday would be (40.37 / 36.40)

       

      i keep getting error on my LOD, would you mind some assistance... thanks

       

      {fixed [Category], datepart('weekday',[Order Date]): sum(  [Sales])}

      /

      {fixed [Category]:SUM([Sales])}

       

        • 1. Re: How to, LOD for ratio of ratio
          Deepak Rai

          SUM({fixed [Category], datepart('weekday',[Order Date]): sum(  [Sales])})/SUM({fixed [Category]:SUM([Sales])})

          • 2. Re: How to, LOD for ratio of ratio
            jon rios

            i came up with this and it works.... but since i am not good with LOD I was wondering if there is a more efficient way to do this... this took 3 calculations.  let me know, thanks

             

            Step 1. % of Total   (= weekday/category % of total )

            {fixed [Category], DATEPART('weekday',[Order Date]): sum([Sales])}

            /

            { fixed DATEPART('weekday',[Order Date]): SUM([Sales]) }

             

            Step 2. Category %    (= category % of total)

            {fixed [Category]: SUM([Sales])}

            /

            { SUM([Sales]) }

             

            Final calculation in View, ratio of ratio   (=% of Weekday/Category to Category % of total)

            [% of Total]  /  [Category %]

             

            • 3. Re: How to, LOD for ratio of ratio
              Deepak Rai

              I think, This is OK as per your Requirement as you need to calculate 2 different Calcs. Another way to do same is

               

              SUM({fixed [Category], DATEPART('weekday',[Order Date]): sum([Sales])}/{ fixed DATEPART('weekday',[Order Date]): SUM([Sales]) })/SUM({fixed [Category]: SUM([Sales])}/{ SUM([Sales]) })

               

               

              Thanks

              Deepak

              Please Close The Thread

              1 of 1 people found this helpful