Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi guys
I have a table which has products for example
Product
A
B
I want the output table as follows:
Product MonthYear
A Jan 2014
A Feb 2014
A Mar 2014
A Apr 2014
B Jan 2014
B Feb 2014
B Mar 2014
B Apr 2014
Please help
Hi
create a calendar table wich every year-month you need and join it with your product table
best regards
Chris
Products:
load * inline [
Product
A
B
];
t:
load
date(makedate(2014) + rowno()-1) as d
AutoGenerate 365;
Months:
load
distinct
capitalize(date(MonthStart(d), 'MMM YYYY')) as Month
resident t
Where month(d) <= 4
;
drop table t;
join (Products)
load * Resident Months;
DROP Table Months;