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

what is the wrong in this script?

let vmindate=num(peek(OrderDate,0,Orders));

let vmaxdate=num(peek(OrderDate,-1,Orders));

tempcalendar:

load

date($(vmindate)+RowNo()-1) as tempdate           ------  I AM  GETTING ERROR HERE SEE ATTACHMENT FOR ERROR COPY

AutoGenerate

$(vmaxdate)-$(vmindate)+1;

mc:

load

tempdate as OrderDate,

week(tempdate) as week,

Year(tempdate) as OrderYear,

     month(tempdate) as month,

     day(tempdate) as day

    

     resident tempcalendar;

3 Replies
tresesco
MVP
MVP

Variables are not getting assigned with values. Try including single quotes aroung table and field  names like:

let vmindate=num(peek('OrderDate',0,'Orders'));

let vmaxdate=num(peek('OrderDate',-1,'Orders'));

sujeetsingh
Master III
Master III

Hope try using

date($(vmindate)+(RowNo()-1)) as tempdate 

jagan
Partner - Champion III
Partner - Champion III

Hi Manoj,

Try like this

CalendarMaster:

LOAD

    Date(InvoiceDate) AS InvoiceDate,

    Year(InvoiceDate) AS Year,

    'Q' & Ceil(Month(InvoiceDate) / 3) AS Quarter,   

    Month(InvoiceDate) As Month,

    Day(InvoiceDate) As Day,

    Week(InvoiceDate) As Week;

Load Date(MinDate + IterNo() -1 ) AS InvoiceDate While (MinDate + IterNo() - 1) <= Num(MaxDate);

Load

    Min(InvoiceDate) AS MinDate,

    Max(InvoiceDate) AS MaxDate

RESIDENT Invoice;

Hope this helps others in generating the Master Calendar.

Regards,

Jagan.