9 Replies Latest reply: Jan 6, 2015 6:29 AM by Aaron Morgan RSS

    Set Analysis Not Returning Expected Results?

    Aaron Morgan

      Hi all,


      I've got an expression that works out the last time an account traded:


      Max({<PeriodNumber, Year, Sales={'>0'}>}Period)"}


      This works fine, and regardless of my selections returns the correct period for each account that it last traded in in a straight table (with Account as the dimension).


      What I'm trying to do is to return the sales total for each account for their last period traded and add this an expression to my table, but it seems to be returning a sum of periods for the value (not just the period I want for each account). The expression I'm using is:


      Sum({<Year, PeriodNumber, Period = {"=Max({<PeriodNumber, Year, Sales = {'>0'} >} Period)"} >} Sales)


      I'm sure it's something simple, but any suggestions as to why it's not just returning the value for the max period?