Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
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
sunny_talwar

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
sunny_talwar

What exactly is the error?

Not applicable
Author

IS this:


//**


Tmp_dates:

LOAD DISTINCT

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

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


//**

aarkay29
Specialist
Specialist

One reason may be

42573,450208137  should be 42573.450208137

dot '.' instead of comma ',' there

sunny_talwar

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);

Not applicable
Author

stalwar1‌,

Was the quotes.

Thanks