4 Replies Latest reply: Jan 29, 2018 10:50 AM by Juan Moreno RSS

    YearMonth in Set Analysis

    Juan Moreno

      Hi,

       

      In an expression I'm writing I want to consider only those records corresponding to last month. I have a calendar with the variable link_YearMonth that takes values such as 2018-01, 2017-12, etc.

       

      I wanted to use Set Analysis in the following manner:

       

      link_YearMonth=Date(AddMonths(Today(),-1),'YYYY-MM')

       

      The complete expression looks like this:

       

      Sum({<[link.id]={'255500','255480','255460'}>}

      Aggr(Avg({<[link.id]={'255500','255480','255460'},link_YearMonth=Date(AddMonths(Today(),-1),'YYYY-MM'),link_WeekDay-={'Sat','Sun'},PeakPeriodId={'1'}>}traveltime/60),[link.id]))

       

      Whenever I add that YearMonth condition in bold, the expression returns zero. Do you see any problem in using it? Is there any alternative condition I can use to restrict the values to last month?

       

      Thanks