Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
The table doesn't have a date field.But my user asks to provide the date from last two years.
Is there any way to get the data.
Thanks..
Yes, we can create
tabCalendar:
LOAD *,
Day(Date) as Day,
WeekDay(Date) as WeekDay,
Week(Date) as Week,
WeekName(Date) as WeekName,
Month(Date) as Month,
MonthName(Date) as MonthName,
Dual('Q'&Ceil(Month(Date)/3),Ceil(Month(Date)/3)) as Quarter,
'Q'&Ceil(Month(Date)/3) & '-' & Year(Date) as QuarterYear,
QuarterName(Date) as QuarterName,
Year(Date) as Year,
Day(Date) & '-' & Month(Date) as DayMonth,
'Week'&Ceil(Day(Date)/7) as WeekNum,
WeekYear(Date) as WeekYear;
LOAD Date(MinDate+IterNo()-1) as Date
While MinDate+IterNo()-1 <= MaxDate;
LOAD MakeDate(2015) as MinDate,
Now() as MaxDate
AutoGenerate 1;
Note: It will return from Jan 01 2015 to Till date
Hi,
As variant
Dates:
LOAD
Date(Date('01.01.2016') + RecNo() - 1) as CalDate
autogenerate(Today() - Date('01.01.2016') + 1);
Regards,
Andrey
Without date how do you want to link the master calendar with you data ? if you simply join then it will become a cross join and Fact will get duplicated for each day ..
Hi Anil,
What ever you suggested is working fine for me also because i tested the script as well, but the question is he don't have DATE column.
Can you please explain once again
Thanks,
Siva
if you don't have a date field do you have any Year, YEarMonth or MOnthYEar fields??
But my user asks to provide the date from last two years.
I assume you want to filter data while loading into script?
His Question is simple. He wants only 2 Years data even Date field is not exist. That is the case, We are making Date field for customer.
That is how it deserve for below process. When ever he want to Club with Master calendar then it big deal. That is the case we can do with All associative in Master calendar also. At least he must have one sequential field with Fact table that is the case we can map with that.
Even if we have atleast Year or month field with you that would be better to create