6 Replies Latest reply: May 21, 2015 2:15 PM by Jonathan Poole RSS

    Create dates in script

    Oscar Marquez

      Hi, I'm trying to create a calendar dimension containing all the possible dates between a min(date) and max(date), I don't knwo if the way I'm doing it si correct / possible? It doesn't fail when refreshing but TIMEDIM table is not created.


      LOAD date(max(ORDERS.SO_DTL_CRT_DT)) as MaxDate,
      date(min(ORDERS.SO_DTL_CRT_DT)) as MinDate
      Resident ORDERS;

      LET vMaxDate = Peek('MaxDate',0,'Dates');
      LET vMinDate = Peek('MinDate',0,'Dates');

      DROP Table Dates;

      LOAD $(vMinDate) + (IterNo()-1) as Date
      while $(vMinDate)+ (IterNo()-1)<= $(vMaxDate);