Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
Not applicable

Script line error in Data values

Hi all,

I'm trying generate a calculation to present date/time values and i'm having this error:


//**

Tmp_dates:

LOAD DISTINCT

  Date(42573,450208137 + RecNo() - 1) AS [Data]

AUTOGENERATE (42619,605902234 - 42573,450208137+1)

//**


The code is:


Temp:

LOAD

     min([DInicio]) as minDate,

     max([DFim]) as maxDate

RESIDENT tmp_f_ados;


Let varMinDate = Num(Peek('minDate', 0, 'Temp'));

Let varMaxDate = Num(Peek('maxDate', 0, 'Temp'));

DROP TABLE Temp;

Tmp_dates:

LOAD DISTINCT

  Date($(varMinDate) + RecNo() - 1) AS [Data]

AUTOGENERATE ($(varMaxDate) - $(varMinDate)+1);

Have anyone any idea thats happing?

many thanks,

1 Solution

Accepted Solutions
Highlighted

Re: Script line error in Data values

May be give this a shot (single quotes around your variables)

Tmp_dates:

LOAD DISTINCT

  Date('$(varMinDate)' + RecNo() - 1) AS [Data]

AUTOGENERATE ('$(varMaxDate)' - '$(varMinDate)'+1);

View solution in original post

5 Replies
Highlighted

Re: Script line error in Data values

What exactly is the error?

Highlighted
Not applicable

Re: Script line error in Data values

IS this:


//**


Tmp_dates:

LOAD DISTINCT

  Date(42573,450208137 + RecNo() - 1) AS [Data]

AUTOGENERATE (42619,605902234 - 42573,450208137+1)


//**

Highlighted
Valued Contributor

Re: Script line error in Data values

One reason may be

42573,450208137  should be 42573.450208137

dot '.' instead of comma ',' there

Highlighted

Re: Script line error in Data values

May be give this a shot (single quotes around your variables)

Tmp_dates:

LOAD DISTINCT

  Date('$(varMinDate)' + RecNo() - 1) AS [Data]

AUTOGENERATE ('$(varMaxDate)' - '$(varMinDate)'+1);

View solution in original post

Highlighted
Not applicable

Re: Script line error in Data values

stalwar1‌,

Was the quotes.

Thanks