3 Replies Latest reply on Sep 26, 2018 10:55 AM by Mavis Liu

    Nested if Statements

    pranavi billa

      Hi Everyone,

      I am trying to write a script which will do Issues/Total Count per region

      I could write for one site (ABC) but unable to add the second site DEF in this script. This Total Count is hardcoded

      SiteRegionIssuesTotal Count
      abcNA13
      abcEU739
      defNA58
      defEU219

       

       

      The script I wrote: 

      ([Issues])

      /

      (SUM(IF [Site] = 'abc' AND [Region] = 'NA' THEN 3 ELSE  139 END)/([Issues]))

        • 1. Re: Nested if Statements
          Naveen B

          Hi Pranavi,

           

          use the IIF([Site] = 'abc' AND [Region] = 'NA' ,3,IIF([Site] = 'abc' AND [Region] = 'EU',5,IIF([Site] = 'def' AND [Region] = 'NA',6,0),0),0)

           

          Like above you can arrange your calculations accordingly

           

          Hope this helps

           

          Plz mark this answer as correct or helpful to close the thread

           

          BR,

          NB

          • 2. Re: Nested if Statements
            Jim Dehner

            Hi

            you can use an LOD like     lod-region-site      {fixed  [region],[site] :sum([total count])}

             

            then the % of total     sum([lod-region-site])/total(sum([total count])

             

            Jim

            If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

            • 3. Re: Nested if Statements
              Mavis Liu

              Hi Pranavi,

               

              Please see the below LOD calculation:

               

              2018-09-26_18h54_12.png

               

              Above I am fixing the value against region and finding the sum of the total count. Then I use issues and divide by the above:

               

              2018-09-26_18h54_56.png

               

              The result is this:

               

              2018-09-26_18h55_10.png

              Please see the attached workbook.

               

              Thanks,

               

              Mavis