Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I am trying to make a master calendar with time.I have loaded an excel file that includes a field with timestamp but when I am trying to load the data, it throws error "Table not Found". Do you have any idea where is the problem?
Thank you
I repeat = does the email table exists before this script is run?
can please share the script ??
Share your script
Dates:
LOAD
Floor(Min(TimeStamp#(mytable, 'MM/DD/YYYY hh:mm:ss'))) AS MinDate,
Floor(Max(TimeStamp#(mytable, 'MM/DD/YYYY hh:mm:ss'))) AS MaxDate
RESIDENT emails;
LET vMinDate = FieldValue('MinDate', 1);
LET vMaxDate = FieldValue('MaxDate', 1);
TempCalendar:
LOAD DayStart(TimeStamp($(vMinDate) + (RecNo()/60/60/24) + (IterNo() -1))) AS DateNumber,
TimeStamp($(vMinDate) + (RecNo()/60/60/24) + (IterNo() -1)) AS TempDate
AYTOGENERATE 86399 WHILE Num($(vMinDate) + IterNo() -1) <= Num($(vMaxDate));
Calendar:
LOAD
TempDate AS mytable,
Hour(TempDate) AS CalenderHour,
Minute(TempDate) AS CalenderMinute,
Date( Floor(TempDate)) AS CalendarDate,
Day(TempDate) AS CalendarDayOfMonth,
Month(TempDate) AS CalendarMonthName,
'Q' & Ceil(Month(TempDate)/3) AS CalendarQuarter,
Year(TempDate) AS CalendarYear,
'Q' & Ceil(Month(TempDate)/3) & '/' & Year(TempDate) AS CalendarQuarterAndYear,
Year(TempDate) & '/' & 'Q' & Ceil(Month(TempDate)/3) AS CalendarYearAndQuarter,
'Wed ' & DayStart(WeekStart(TempDate) + 3) as CalendarWednesdays
RESIDENT TempCalendar ORDER BY TempDate ASC;
DROP TABLE TempCalendar;
DROP Table Dates;
// I found the code by a post here and I made some modifications but I don't understand whythe table can't be found.
can you share the sample data too??
I think you need to check whether the data is in the date format or not otherwise the date function won't work on top of that....
check with the Mindate, Maxdate ?? whether the its on date format or not
Which line is triggering the error?
Does the email table exist before this script is run?
Hi,
Is 'aytogenerate' a valid syntax? Possible that the table therefore is not created?
Regards,
In the beggining. I have loaded the excel file with two fields: 1.mailinglist 2.mytable (contains timestamp). The work sheet in excel file is called mails. I don't find how to upload the excel file.
The data format is: M/D/YYYY h:mm:ss in Greek (Also I correct the code at this part but it's not working again)
Thank you for your quick response
May be you can try this
set the variable vMinDate= to minimum date and vMaxDate to your maximum date from your excel file (exclude the time part)
/*
Dates:
LOAD
Floor(Min(TimeStamp#(mytable, 'MM/DD/YYYY hh:mm:ss'))) AS MinDate,
Floor(Max(TimeStamp#(mytable, 'MM/DD/YYYY hh:mm:ss'))) AS MaxDate
RESIDENT emails;
*/
LET vMinDate =num(date(date#('01/20/2005','MM/DD/YYYY'),'MM/DD/YYYY'));
LET vMaxDate = num(date(date#('07/28/2015','MM/DD/YYYY'), 'MM/DD/YYYY'));
TempCalendar:
LOAD $(vMinDate) + Iterno()-1 As Num,
Date($(vMinDate) + IterNo() - 1) as TempDate
AutoGenerate 1 While $(vMinDate) + IterNo() -1 <= $(vMaxDate);
Calendar:
LOAD
TempDate AS mytable,
Hour(TempDate) AS CalenderHour,
Minute(TempDate) AS CalenderMinute,
Date( Floor(TempDate)) AS CalendarDate,
Day(TempDate) AS CalendarDayOfMonth,
Month(TempDate) AS CalendarMonthName,
'Q' & Ceil(Month(TempDate)/3) AS CalendarQuarter,
Year(TempDate) AS CalendarYear,
'Q' & Ceil(Month(TempDate)/3) & '/' & Year(TempDate) AS CalendarQuarterAndYear,
Year(TempDate) & '/' & 'Q' & Ceil(Month(TempDate)/3) AS CalendarYearAndQuarter,
'Wed ' & DayStart(WeekStart(TempDate) + 3) as CalendarWednesdays
RESIDENT TempCalendar ORDER BY TempDate ASC;
DROP TABLE TempCalendar;
//DROP Table Dates;
HTH
Sasi
the excel file I use