4 Replies Latest reply: Aug 9, 2012 8:13 AM by Henric Cronström RSS

    Script

      Hi Guys

       

      I have the data in the folowing format

       

      ProductId       Amt     Date

      1                     100     01/08/2012

      2                      150     03/08/2012

      1                      200     04/08/2012

      2                       300     05/08/2012

       

       

      The above date column will be linked to the master Calendar

      So My requirement is that when the User will click on Say 02/08/2012 or 03/08/2012 then

      i should get

      ProductId  Amt

      1                100

       

      and when the User will click on 05/08/2012

      then

       

      ProductId Amt

      1               200

       

      Similarly for the productId 2

        • Re: Script
          Some Nath Roy

          Hi,

           

          Create Straight Table and add ProductID as dimension and add

          Only({<Date = {'$(=Max({< Date = {"<$(=Max(Date))"} >} Date))'}>} Amt) as expression.

           

          For your ready reference find the attachement.

           

          Regards,

          som

            • Re: Script

              Thanks for the reply... but can i do it in Back End ... may be by using Intervalmatch???

                • Re: Script
                  Some Nath Roy

                  Hi Manish,

                   

                  My previous post needs a small updatation:

                   

                  Updated Script:

                  LOAD ProductId, Amt, Date(Date#(Date,'DD/MM/YYYY'), 'DD/MM/YYYY') as Date, Date(Date#(Date,'DD/MM/YYYY'), 'DD/MM/YYYY') as DateAvailable;

                  LOAD * inline

                  [ProductId   ,    Amt  ,   Date

                  1         ,            100   , 01/08/2012

                  2          ,            150    , 03/08/2012

                  1            ,          200     ,04/08/2012

                  2           ,            300   ,  05/08/2012];

                   

                   

                  Updated Expression:

                  Only({<Date = {'$(=Max({< DateAvailable = {"<$(=Max(Date))"} >} DateAvailable))'}>} Amt)

                   

                   

                  Regards,

                  Som


              • Re: Script
                Henric Cronström

                I wouldn't use Set Analysis for this. I would do it in the script by propagating the value from the previous day to the next.. 

                 

                See attachment for a script solution.

                 

                HIC