8 Replies Latest reply: Oct 2, 2018 9:28 AM by Beck Bakytbek RSS

    autocalender: problem with expressions

    Beck Bakytbek

      Hi Folks,

       

      i have the following Situation, i created the master calender with the help of functions: declare field Definition, see below:

       

      [autoCalendar]:
      DECLARE FIELD DEFINITION Tagged ('$date')
      FIELDS
      Dual(Year($1), YearStart($1)) AS [Year] Tagged ('$axis', '$year'),
      Dual('Q'&Num(Ceil(Num(Month($1))/3)),Num(Ceil(NUM(Month($1))/3),00)) AS [Quarter] Tagged

      ('$quarter'),
      Dual(Year($1)&'-Q'&Num(Ceil(Num(Month($1))/3)),QuarterStart($1)) AS [YearQuarter] Tagged

      ('$axis', '$yearquarter'),
      Month($1) AS [Month] Tagged ('$month'),
      Dual(Year($1)&'-'&Month($1), monthstart($1)) AS [YearMonth] Tagged ('$axis', '$yearmonth'),
      Dual('W'&Num(Week($1),00), Num(Week($1),00)) AS [Week] Tagged ('$weeknumber'),
      Date(Floor($1)) AS [Date] Tagged ('$date');

      DERIVE FIELDS FROM FIELDS [datum] USING [autoCalendar]

       

      my Problem is:

       

      if i try to build the Expression: sum({$<[datum.autoCalendar.Year] = {$(=max([datum.autoCalendar.Year]))}>}budget) but it does not work,

       

      but if i transform the field:datum in year(datum) as test_year and then create the Expression:

       

      sum({$<test_year = {$(=max(test_year)-1)}>}budget) then it does work.

       

      Can anybody explain me these differences?

      or if i create the datafields with the helps of function: declare fields i can not use that in set expressions.

       

      Thanks a lot

      Beck