12 Replies Latest reply: Jun 27, 2016 10:25 AM by PAUL YEO RSS

    How to make my both 2 expression display GP = 50.2% ?

    PAUL YEO

      Hi All

       

       

      Below expression return correct GP = 50.2% :-

       

       

      1-

      (

      sum({$<year = {$(=max(year)-1)}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>} cost)

      )

      /

      (

      sum({$<year = {$(=max(year)-1)}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>} sales)

      )

       

       

      This is because below 2 load script are working fine :-

       

       

      if(@241:248T = '2',@137:151T*-1,@137:151T) as [sales],

       

       

      if(@241:248T = '2',@122:135T*-1,@122:135T) as [cost],

       

       

       

       

       

       

      Below return wrong GP = 49% :-

      (

      sum({$<year = {$(=max(year)-1)}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>} profit_amt)

      )

      /

      (

      sum({$<year = {$(=max(year)-1)}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>} sales)

      )

       

       

       

       

      This is because below script is not working fine :-

       

       

      if(@241:248T = '2',@137:151T*-1,@137:151T)- (@122:135T ) as profit_amt,

       

       

       

       

      Hope some one can help me modify the above script, so that i can get the same GP% for above 2 expression.

       

       

      Paul