Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
can we create date from year and quarter field
Hi Swetha,
Try this script below
LOAD *,
MakeDate(Year, Quarter*3) AS Date,
SubField(Quarter*3 & '/' & (Quarter*3 - 1) & '/' & (Quarter*3 - 2), '/') AS Month
INLINE [
Year, Quarter
2015, 1
2015, 2
2015, 3
2015, 4
];
Regards,
Jagan.
Please share sample data.
try like this
makedate(year,quarter) as date
The makedate function only accepts year, month and day as parameters.
Hi Shweta,
Build a custom calendar and like the Quarter and year ...that the easiest way to generate dates
how?
Derive Month from Quarter And use makedate function with year and derived month,
If quarter = Q1, Month = Jan or Feb Or Mar Like this,
and Makedate(year, Month) As Date
Faisal
Assuming quarter is a number between 1 and 4:
=MakeDate(year, (quarter - 1) * 3 + 1)
pfa
Try this code
tab1:
LOAD * INLINE [
Year, Quarter
2015, 1
2015, 2
2015, 3
2015, 4
];
tab2:
LOAD *,
Date(Makedate(Year,Month),'DD-MM-YYYY') AS Date;
LOAD Year,
Quarter,
Pick(Match(Quarter,1,2,3,4),1,4,6,10) AS Month
RESIDENT tab1;
DROP TABLE tab1;