Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Get error massage when i try to create master calendar

Hi All

I get following error msg :-

Script line error:

TempCalendar:

LOAD

  + rowno() - 1 AS Num,

  date( + rowno() - 1) AS TempDate,

  date( + rowno() - 1) AS D,

  year( + rowno() - 1) AS Y,

  month( + rowno() - 1) AS M,

  date(monthstart( + rowno() - 1), 'MMM-YYYY') AS MY

AUTOGENERATE  -  + 1

Can some one share with me where i go wrong ?

Paul

1 Solution

Accepted Solutions
Alejandro_Hernández
Former Employee
Former Employee

21 Replies
Not applicable
Author

Hi Paul

Try The below script.. Hope it will help

AutoGenerationDate:

Load

RecNo( ) as A,

if(RecNo()=1,date(MakeDate(2001,1,1)),date((Peek("AutoDate")+1))) as AutoDate,

date(if(RecNo()=1,date(MakeDate(2001,1,1)),date((Peek("AutoDate")+1))),'DD/MM/YYYY') as AutoDate_new,

year(if(RecNo()=1,date(MakeDate(2001,1,1)),date((Peek("AutoDate")+1)))) as AutoYear,

Month(if(RecNo()=1,date(MakeDate(2001,1,1)),date((Peek("AutoDate")+1)))) as NormalMonth,

MonthName(if(RecNo()=1,date(MakeDate(2001,1,1)),date((Peek("AutoDate")+1)))) as My,

if(wildmatch(month((if(RecNo()=1,date(MakeDate(2001,1,1)),date((Peek("AutoDate")+1))))),'Jan','Feb','Mar'),year((if(RecNo()=1,date(MakeDate(2001,1,1)),date((Peek("AutoDate")+1)))))-1,year((if(RecNo()=1,date(MakeDate(2001,1,1)),date((Peek("AutoDate")+1)))))) as Fin_Year,

if(month((if(RecNo()=1,date(MakeDate(2001,1,1)),date((Peek("AutoDate")+1)))))<=3,month((if(RecNo()=1,date(MakeDate(2001,1,1)),date((Peek("AutoDate")+1)))))+9,month((if(RecNo()=1,date(MakeDate(2001,1,1)),date((Peek("AutoDate")+1)))))-3) as Fin_Month

autogenerate(50000);

Left Join(AutoGenerationDate)

//Entry_DT_QTR:

LOAD * INLINE [

Fin_Month, Month_New,QTR

1, Apr,Q1

2, May,Q1

3, Jun,Q1

4, Jul,Q2

5, Aug,Q2

6, Sep,Q2

7, Oct,Q3

8, Nov,Q3

9, Dec,Q3

10, Jan,Q4

11, Feb,Q4

12, Mar,Q4

];

Not applicable
Author

Hi sir

Thank you for your script very special.

The 2 table not link by date field.

i try to link by Date field.

But it cannot work.

Not applicable
Author

Can you post your application

Not applicable
Author

see my QV doc

Not applicable
Author

try to reload now

Not applicable
Author

Hi Paul,

You are just missing a comma after "MY". Try this:

 

TempCalendar:

LOAD
+
rowno() - 1 AS Num,
date( + rowno() - 1) AS TempDate,
date( + rowno() - 1) AS D,
year( + rowno() - 1) AS Y,
month( + rowno() - 1) AS M,
date(monthstart( + rowno() - 1), 'MMM-YYYY') AS MY,
AUTOGENERATE - + 1
;
Hope this helps!

Not applicable
Author

Hi Shy

After add the comma , the error msg go away.

Now another issue came out , it does generate a calendar table.

Why ?

Not applicable
Author

Hi Paul,

Not sure if  I understand you. Can you elaborate a little?

Not applicable
Author

Have you try the below one