3 Replies Latest reply: Jun 26, 2013 8:12 AM by Danielle van Eeden RSS

    Aggr and Set Analysis (YTD Expression)

    Danielle van Eeden

      Hi All,

       

      My dataset is based around orders, and there can be multiple items per order, so my data is at Order-Item level.However, I need to calculate the average number of DaysToDeliver at Order level, so I have been using the following expression;

       

      avg(aggr(only(DaysToDeliver),Order))

       

      This works fine, but when I try and amend the expression so that it is looking at Year to Date (based on week and month calendar selections), it doesn't seem to bring back the correct results.

       

      The expression I have been using is;

       

      avg(aggr(only(

      {$<DeliveryCalWeek = {"<=$(=max(DeliveryCalWeek))"}, 

      DeliveryCalMonth = {"<=$(=max(DeliveryCalMonth))"}>}

      DaysToDeliver), Order))

       

      Whatever I try, it seems to be ignoring the week and month parts of the expression. This works fine without AGGR, so I'm assuming it is this thats stopping the calculation from working correctly. I just can't figure out why, or how to correct it.

       

      Not sure if this makes any difference. but it's a straight table I'm trying to use this expression in.

       

      Any help much appreciated!