9 Replies Latest reply: Dec 20, 2016 7:23 AM by Magnus Buseth RSS

    Nested functions in set analysis

    Magnus Buseth

      I want to create a measure that sums the subscriptions for the previous month.


      I currently use this expression to find the subscribers in the current month:

      sum({<[Date]= {"$(=Max({<Subscriptions = {">0"}>} Date))"}>}Subscriptions)


      (The reason I have filter only months with subscribers > 0 is that I have future dates in my data)


      This expression correctly returns the previous month:

      AddMonths(Max({<Subscriptions = {">0"}>}Date), -1)


      However, I am not able get it working when trying to combine these expressions into:

      sum({<[Date]= {"$(=AddMonths(Max({<Subscriptions = {">0"}>}Date), -1)"}>}Subscriptions)

      I have tried several different syntaxes without luck. I suspect it is because of the nested functions?


      Can anyone help me on the way?