7 Replies Latest reply: Mar 10, 2017 5:20 AM by Karthik Srinivasan RSS

    Time Buckets Syntax Error !!!!

    Chanin D'Souza

      Hi to all,

      Can someone please help me correct the syntax of this equation :

      Interval(if((Date((now()),'HH')-Date(Date#(AND_allocatedDate2,'DD-MM-YYYY hh:mm:ss TT'),'HH'),'HH') < 1,'< 1 hour',

                  if((Date((now()),'HH')-Date(Date#(AND_allocatedDate2,'DD-MM-YYYY hh:mm:ss TT'),'HH'),'HH') < 2,'< 2 hours',

                  if((Date((now()),'HH')-Date(Date#(AND_allocatedDate2,'DD-MM-YYYY hh:mm:ss TT'),'HH'),'HH') < 3,'< 3 hours',

                  if((Date((now()),'HH')-Date(Date#(AND_allocatedDate2,'DD-MM-YYYY hh:mm:ss TT'),'HH'),'HH') < 4,'< 4 hours','> 4                         hours')))))


      Where, And_allocatedDate2 is the [Field Name].

       

      The error is showing as ')' expected.

       

      But however when I'm using a single expression and whenthe date is specified, its working fine, for example :

      Interval(Date((now()),'HH')-Date(Date#('01-03-2017 12:00:00 PM','DD-MM-YYYY hh:mm:ss TT'),'HH'),'HH')

      Gives me the correct answer, however when implementing it in the Time Bucket format, its showing a syntax error.

       

      It will be of great help if someone can guide me.

      Thanks in advance.

        • Re: Time Buckets Syntax Error !!!!
          kaan erisen

          Hi,

          You send 'HH' as parameters but which function

           

          Interval(if((Date((now()),'HH')-Date(Date#(AND_allocatedDate2,'DD-MM-YYYY hh:mm:ss TT'),'HH'),'HH') < 1,'< 1 hour',

                      if((Date((now()),'HH')-Date(Date#(AND_allocatedDate2,'DD-MM-YYYY hh:mm:ss TT'),'HH'),'HH') < 2,'< 2 hours',

                      if((Date((now()),'HH')-Date(Date#(AND_allocatedDate2,'DD-MM-YYYY hh:mm:ss TT'),'HH'),'HH') < 3,'< 3 hours',

                      if((Date((now()),'HH')-Date(Date#(AND_allocatedDate2,'DD-MM-YYYY hh:mm:ss TT'),'HH'),'HH') < 4,'< 4 hours','> 4hours')))))

           

          I assume you are trying to send it to the interval function

          Maybe you try this :

           

          if(Interval(Date((now()),'HH')-Date(Date#(AND_allocatedDate2,'DD-MM-YYYY hh:mm:ss TT'),'HH'),'HH') < 1,'< 1 hour',

          if(Interval(Date((now()),'HH')-Date(Date#(AND_allocatedDate2,'DD-MM-YYYY hh:mm:ss TT'),'HH'),'HH') < 2,'< 2 hours',

          if(Interval(Date((now()),'HH')-Date(Date#(AND_allocatedDate2,'DD-MM-YYYY hh:mm:ss TT'),'HH'),'HH') < 3,'< 3 hours',

          if(Interval(Date((now()),'HH')-Date(Date#(AND_allocatedDate2,'DD-MM-YYYY hh:mm:ss TT'),'HH'),'HH') < 4,'< 4 hours','> 4hours'))))

          • Re: Time Buckets Syntax Error !!!!
            Vineeth Pujari

            Try like below

             

            =Pick(Interval(Date((now()),'HH') -

            Date(Date#(AND_allocatedDate2,'DD-MM-YYYY hh:mm:ss TT'),'HH'),'H'),

            '<1 Hr','<2 Hr','<3 Hr','<4 Hr')