7 Replies Latest reply: Mar 20, 2014 11:08 AM by Alec Smith RSS

    Multiple Conditions In A Set Analysis Expression

    Alec Smith

      Hello,

       

      I am trying to calculate the YTD sales amount net of YTD freight charges.  The first expression calculates the YTD sales amount and the second expression calculates the freight amount.  I added them together to compute the net YTD sales.  Both expressions work with a Year and Month list box (See attached screen).

       

      The issue is that I am not getting any numbers.  I confirmed that the first expression works, but when I add on the second expression the whole thing fails.  The second expression is a copy of the first one with the additional script at the end (see underlined text below) that represents the freight amount. 

       

      I believe the way I added the underlined text is wrong, but not sure how to correct it.

       

      (sum({$<Year = {$(=max(Year))}, Month = {"<=$(=max({<Year={$(=max(Year))}>} Month))"}>} MainAmount)) +

      (sum({$<Year = {$(=max(Year))}, Month = {"<=$(=max({<Year={$(=max(Year))}>} Month))"}, Amount = {"<$(=RowType{6})>} Amount))
        


      Thank you in a advance for any help on this.