3 Replies Latest reply: Sep 28, 2015 3:17 AM by Prashant Sangle RSS

    Create New Dimension  of Available ِData

      hello dears

      i want create Dimension  of Available ِData

      i want Create New Dimension That Have 2 Record ,Item1 and Item 2

      Item 1 Filter Data Between 01/01/2014 to 06/01/2014

      And Item 2 Filter Data Between 07/01/2014 to 07/05/2014

      plz help me

       

      Pic.png

        • Re: Create New Dimension  of Available ِData
          Gysbert Wassenaar

          Best way is to create that field in the script:

           

          LET Start = num(makedate(2014,1,1));

          LET End = num(makedate(2014,5,30));

          LET NumOfDays = End - Start + 1;

           

          k_tmp:

          load

            $(Start) + Rowno()-1 as dateTMP

          AutoGenerate $(NumOfDays);

           

          k:

          LOAD *,

            if(Activation_date >= makedate(2014,1,1) and  Activation_date <= makedate(2014,1,6), 'Item1',

            if(Activation_date >= makedate(2014,1,7) and  Activation_date <= makedate(2014,5,7), 'Item2')) as Item;

          load

            Date(dateTMP) as Activation_date,

              Year(dateTMP) as Year,

              Month(dateTMP) as Month,

              Day(dateTMP) as Day,

              WeekDay(dateTMP) as WeekName,

              Week(dateTMP) as Week,

              Month (dateTMP) &'-'&Year (dateTMP) as MMYYYY

          Resident k_tmp;

           

          DROP Table k_tmp;

           

          If you don't like that then you can try an expression for the listbox:

          =if(Activation_date >= makedate(2014,1,1) and  Activation_date <= makedate(2014,1,6), 'Item1',

            if(Activation_date >= makedate(2014,1,7) and  Activation_date <= makedate(2014,5,7), 'Item2'))