Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Morning ladies and gentleman,
Just a curious question, lets say i have this data set with 1 column
MonthNumber
1
2
3
4
What is a good way to get the Month Name from Month Number?
i.e. Function(1) = Jan
I am aware of the workaround such as using a "fake year" to get them but would like to see if there are other "cleaner" methods to do it.
i.e. Month(MakeDate(2015,MonthNumber))
Appreciate the assistance and insights. Thank you.
There are no function available that converts 1, 2, ..., 12 into Jan, Feb, ..., dec. You will have to go through makedate() or date#() to get there.
An workaround is to first define your Month as a Dual value, then its enough to use the digit to get the right value.
TmpMonth:
Load dual(Text, Value) as Month
Inline [
Text, Value
Jan., 1
Feb., 2
....
Dec., 12
];
Load
ID,
Value,
Dim,
MonthNo as Month
From ...;
Drop table tmpMonth;
Month(Date#(MonthNumber,'M'))
There are no function available that converts 1, 2, ..., 12 into Jan, Feb, ..., dec. You will have to go through makedate() or date#() to get there.
An workaround is to first define your Month as a Dual value, then its enough to use the digit to get the right value.
TmpMonth:
Load dual(Text, Value) as Month
Inline [
Text, Value
Jan., 1
Feb., 2
....
Dec., 12
];
Load
ID,
Value,
Dim,
MonthNo as Month
From ...;
Drop table tmpMonth;
Month(Date#(MonthNumber,'M'))