Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
chriys1337
Creator III
Creator III

applymap does not work?

Hi all,

I want to replace the short month names, e.g. Jan with the full version, e.g January.

For this purpose I tried to use applymap, but it does not work - why? Could you help me?

MonthMapping:
Mapping LOAD * INLINE [

Date of Entry Month, Date of Entry Month long

Jan, January

Feb, February

Mar, March

Apr, April

May, May

Jun, June

Jul, July

Aug, August

Sep, September

Oct, October

Nov, November

Dec, December]
;

LOAD *, applyMap('MonthMapping',[Date of Entry Month], 'N/A') as [Date of Entry Month long]; // preceding load
[$(vL.TableName)]:
LOAD  
left(num(TempDate),5) as [Date of entry], // just Day, Month and Year indication
  date#(TempDate,'MM/DD/YYYY') as [Date of entry Date],
year(TempDate) as [Date of Entry Year],
month(TempDate) as [Date of Entry Month],
num(month(TempDate)) as [Date of Entry Month num],
weekyear(TempDate) as [Date of Entry CW],
day(TempDate) as [Date of Entry Day]
RESIDENT TempCal;

Just N/A comes out, which shows me that there is no match. If I don't fill out the third parameter at my applymap, the original text remains, e.g. Jan, Feb... and not the long version as I wish.

1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

And the reason why the applymap() call doesn't seem to work is probably because you are passing a dual value but the mapping table only contains text values. Try again by modifying the first INLINE LOAD column from Jan to 1, Feb to 2 and so on. That is, if you didn't already decide to use Manish's more efficient solution.

View solution in original post

3 Replies
MK_QSL
MVP
MVP

Use

Date(TempDate,'MMMM') as [Date of Entry Month long],

month(TempDate) as [Date of Entry Month],

You don't need Mapping Load here.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

And the reason why the applymap() call doesn't seem to work is probably because you are passing a dual value but the mapping table only contains text values. Try again by modifying the first INLINE LOAD column from Jan to 1, Feb to 2 and so on. That is, if you didn't already decide to use Manish's more efficient solution.

chriys1337
Creator III
Creator III
Author

Thank you both, both true :-).