Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
how can I create a calendar having the year values only ?
For example:
periodo between 2010 and 2012
Is is possible without a range date ?
Thanks in advance
HI
Ya , its give.. For additional information..
Try like this
Let vEnd = Num(Today(1));
Let vStart = Num(YearStart($(vEnd),-4)) - 1;
Generate:
LOAD Date($(vStart) + IterNo()) AS Date , num((rand() * 100) + 1000, '##0') as Sales
AutoGenerate 1
While ($(vStart) + IterNo()) <= $(vEnd);
Tablename:
LOAD Month(Date)*1 AS MonthKey1, Month(Date) as Month,Year(Date) AS Year,Day(Date) AS Day,Num(Date) as DateNUm ,
Dual('Q' & Ceil(Month(Date) / 3) & ' ' & Year(Date), QuarterName(Date)) as Quarter,
MonthName(Date) as Monthyear
Resident Generate;
Hope that helps..
Hi
I think , if i understand your requirement, r u looking like this?
Load
Year(DateField) as Year,
Sales
From TableName;
Its load year and sales value only..without load the date field.
Yes, but I solved maybe.
I created the calendar by the makedate function: makedate(firstyear, 01,01) as mindate and makedate(lastyear,12,31) as maxdate. It should be correct, I hope...
Thanks for your attention
stefan
HI
Ya , its give.. For additional information..
Try like this
Let vEnd = Num(Today(1));
Let vStart = Num(YearStart($(vEnd),-4)) - 1;
Generate:
LOAD Date($(vStart) + IterNo()) AS Date , num((rand() * 100) + 1000, '##0') as Sales
AutoGenerate 1
While ($(vStart) + IterNo()) <= $(vEnd);
Tablename:
LOAD Month(Date)*1 AS MonthKey1, Month(Date) as Month,Year(Date) AS Year,Day(Date) AS Day,Num(Date) as DateNUm ,
Dual('Q' & Ceil(Month(Date) / 3) & ' ' & Year(Date), QuarterName(Date)) as Quarter,
MonthName(Date) as Monthyear
Resident Generate;
Hope that helps..
Thanks, really much more complete.