Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
fixed it for you
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
];
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.
Can you post your application
see my QV doc
try to reload now
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!
Hi Shy
After add the comma , the error msg go away.
Now another issue came out , it does generate a calendar table.
Why ?
Hi Paul,
Not sure if I understand you. Can you elaborate a little?
Have you try the below one