6 Replies Latest reply: Nov 16, 2017 2:42 PM by David Toomey RSS

    Margin for Selected Category

    David Toomey

      Hello,

       

      I am attempting to create a table that will produce the margin % for a specific category. I have been attempting to use the following code:

       

       

      (Sum({<[Distribution Channel] = {'Parts'}>}if([Total Revenue]<100 and [Total Revenue]>1,[Total Revenue],''))
      -
      Sum({<[Distribution Channel] = {'Parts'}>}if([Total Revenue]<100 and [Total Revenue]>1,[Total Cost],'')))
      /
      (
      Sum({<[Distribution Channel] = {'Parts'}>}if([Total Revenue]<100 and [Total Revenue]>1,[Total Revenue],'')))

       

      Currently, this only outputs 100%. I believe that the cost portion is coming in as 0 because the if statement is dependent on the "Total Revenue" instead of the "Total Cost". Any thoughts on how to remedy the issue? Is there a way to pull the category in the code before I perform the sum function?

       

      Thanks,

      Dave