Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Everybody,
I have this table where the month column is empty.
Data Type | Year | Month | Amount |
---|---|---|---|
B15 | 2015 | 200 | |
B15 | 2015 | 1200 | |
B15 | 2015 | 12 | |
B15 | 2015 | 36 | |
B15 | 2015 | 60 |
I want to integrate all months of the year. I currently have six lines in my picture.
In the end I would like to have a table of 6 * 12.
thank you for your help.
Message was edited by: Onno van Knotsenburg; changed the title from "Help" to the current title.
LOAD
DataType,
Year,
Amount
FROM YourTable;
JOIN
LOAD Month(makedate(2015, recno() )) as Month
autogenerate 12;
LOAD
DataType,
Year,
Amount
FROM YourTable;
JOIN
LOAD Month(makedate(2015, recno() )) as Month
autogenerate 12;
Thanks swuehi,
Well done.
if I have any Year and any Data type.
How do you do?
Not sure if I understand. Above code should work with any Year and DataType, creating 12 Month records per original table row.
The year 2015 in the makedate() function is an arbitrary value, since we are only interested in the Month.