Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good morning everyone,
Usually I do create a quarter field from my date field that comes in this form... DD/MM/YYYY.
But I has a unique data fields that looks like this
Year | Month` | Figures |
---|---|---|
2012 | January | 56 |
2012 | February | 78 |
2012 | March | 90 |
How do I create a quarter field from the above data set?
Thank you for your anticapted response,
Regards
Thanks Sunny
Still having errors. See attached
Missed a comma
LIB CONNECT TO ' Planning';
LOAD *,
'Q' & Ceil(Month(Date)/3) as Quarter,
Date;
LOAD *,
Date(Date#(Year&Month, 'YYYYMMMM')) as Date;
LOAD if(Len(Trim("Year")) = 0, Peek ("Year"), "Year") as "Year",
if(Len(Trim("Month")) = 0, Peek ("Month"), "Month") as "Month",
"Field",
Figures;
SQL SELECT "Year",
"Month",
"Field",
Figures
FROM " Planning".dbo.Planning;
Hello Sunny, Thank you sir,
I had to change a line so it can work...
LOAD *,
if( Isnum(Date), 'Q')& Ceil(Month(Date)/3) as Quarter;
LOAD *,
Date(Date#(Year&Month, 'YYYYMMMM')) as Date;
LOAD if(Len(Trim("Year")) = 0, Peek ("Year"), "Year") as "Year",
if(Len(Trim("Month")) = 0, Peek ("Month"), "Month") as "Month",
"Field",
Figures;
SQL SELECT "Year",
"Month",
"Field",
Figures
FROM Planning".dbo.Planning;
And it worked..
Thanks everyone
Thank you Sir