Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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

1 Solution

Accepted Solutions
Not applicable
Author

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

View solution in original post

8 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

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

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

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

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

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.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

No joy I am afraid. Your first suspicion is right I think … the values are not making it to the variable.

vToday

I am just not sure why as the table exists, there is data in the table and when I use the same syntax in a text box, I get a value.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    Then i think the sample qvw from your side can help us to solve this problem

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

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