8 Replies Latest reply: Oct 7, 2011 7:36 AM by Lee Alderdice RSS

    Syntax Error

      Hi,

       

      I am getting a syntax error on the below section of script, running through debug is giving no guidance on the issue other than it is around DateIsland:

       

      TEMP:

      LOAD

                num(min(MasterDate)) AS MinDate,

                num(max(MasterDate)) AS MaxDate

      RESIDENT

                Liability;

       

       

      LET vMinDate = peek('MinDate', 0, 'TEMP');

      LET vMaxDate = peek('MaxDate', 0, 'TEMP');

       

       

      DateIsland:

      LOAD

                date($(vMinDate) + rowno() - 1) AS D,

                year($(vMinDate) + rowno() - 1) AS Y,

                month($(vMinDate) + rowno() - 1) AS M,

                date(monthstart($(vMinDate) + rowno() - 1), 'MMM-YYYY') AS MY

      AUTOGENERATE

                vMaxDate - vMinDate + 1;

       

      Can anyone see anything wrong?

       

      Thanks

       

      Lee

        • Syntax Error
          Kaushik Solanki

          Hi,

           

               Can you tell us whats the error that you are getting..?

           

          Regards,

          Kaushik Solanki

            • Re: Syntax Error

              Hi,

               

               

               

              This is all I get.

               

               

               

              Script line error:

               

              DateIsland:

               

              LOAD

               

                              date( + rowno() - 1) AS D,

               

                              year( + rowno() - 1) AS Y,

               

                              month( + rowno() - 1) AS M,

               

                              date(monthstart( + rowno() - 1), 'MMM-YYYY') AS MY

               

              AUTOGENERATE

               

                              vMaxDate - vMinDate + 1

               

               

               

              Thanks

               

               

               

              Lee

                • Re: Syntax Error
                  Kaushik Solanki

                  Hi,

                   

                      It means that your variable didnt got the proper values.

                   

                      Make sure that the values you picked with peek function is on proper index.

                   

                      If you can provide the qvw that will be good to solve your problem.

                   

                  Regards,

                  Kaushik Solanki

                    • Re: Syntax Error

                      I am afraid that I can’t post the qvw.  Using the same peek function in the front end on the table holding the data the variable is trying to use I get MIN = 39448 and MAX=40909

                       

                       

                       

                      That seems OK to me.

                        • Re: Syntax Error
                          Kaushik Solanki

                          Hi,

                           

                              Its ok.

                           

                              Try something like this.

                           

                             

                          DateIsland:

                          LOAD

                                    date('$(vMinDate)' + rowno() - 1) AS D,

                                    year('$(vMinDate)' + rowno() - 1) AS Y,

                                    month('$(vMinDate)' + rowno() - 1) AS M,

                                    date(monthstart('$(vMinDate)' + rowno() - 1), 'MMM-YYYY') AS MY

                          AUTOGENERATE

                                     vMaxDate - vMinDate + 1

                           

                           

                          Regards,

                          Kaushik Solanki

                  • Re: Syntax Error

                    Ah ... solved.  I have 4 separate calendars that I must load ... a clash of variables from a previous sheet!