Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a field named [Year/month] and the values look like this: 2018/01 I need to pull out the Year value and the Month value as a name. I want to do this in the script. How can I do this?
Date#([Year/month],'YYYY/MM') as [Year/month],
Year(Date#([Year/month],'YYYY/MM')) as Year,
Month(Date#([Year/month],'YYYY/MM')) as Month
use the subfield function in the expr where ever you would like to
subfield([Year/month],'/',1) for field Year and subfield([Year/month],'/',2) for Month
Left([Year/month], 4) AS MyYear, Right([Year/month], 2) AS MyMonth
I need the MyMonth to be Month name and not Month num.
use inline load as
Mnth_Map:
Mapping Load * INLINE
[ Mnth_Num,Mnth_Name
1, Jan
2,Feb
3,Mar
]
then use
ApplyMap('Mnth_Map',subfield([Year/month],'/',2) ) as Month_Name,
subfield([Year/month],'/',1) as Year
Have you tried as per my answer?
You will get something like below.
Month(MakeDate(2018,Right([Year/month], 2))) as MyMonthName
I need the full moth name.
Data:
Load
Date#([Year/month],'YYYY/MM') as [Year/month],
Year(Date#([Year/month],'YYYY/MM')) as Year,
Date(Date#(Month(Date#([Year/month],'YYYY/MM')),'MMM'),'MMMM') as Month
Inline
[
Year/month
2018/01
2018/02
2018/03
];