Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

Re: Syntax Error

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

8 Replies

Syntax Error

Hi,

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

Regards,

Kaushik Solanki

Not applicable

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

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

Not applicable

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

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

Not applicable

Re: Syntax Error

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.

Re: Syntax Error

Hi,

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

Regards,

Kaushik Solanki

Not applicable

Re: Syntax Error

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

Community Browser