Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

load Month as Jan,Feb, Mar, etc instead of 01,02,03...

Hi, I have a date field from which I need to extract the month.

I am doing this in the main script. 

The field is in the format dd/mm/yyyy and am using the formula month(AuditDate) as AuditMonth

Is there a way I can load the AuditMonth as Jan, Feb, Mar, etc instead of having 01,02, 03 without using an in-line table?

5 Replies
vikasmahajan

TRY


month(date(AuditDate,'DD/MM/YYYY')) as AuditMonth

VIKAS

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
tresesco
MVP
MVP

Month() function should give you the result you want. If that is not working try:

Date(AuditDate,'MMM') as Month    // to check if it comes properly

Or,

If your AuditDate is not being read really as date, then try:

Month(Date#(AuditDate,'DD/MM/YYYY')) as Month

Not applicable
Author

Hi,

  You can create following Inline table and you can use the Month field in the UI

LOAD * INLINE [

    Audit, Month

    01, Jan

    02, Feb

    03, mar

    04, Apr

    05, May

    06, Jun

    07, Jul

    08, Aug

    09, Sep

    10, Oct

    11, Nov

    12, Dec

];

-Jay

er_mohit
Master II
Master II

TRY THIS in Main tab and comment the set statement  for monthnames and write below statement

SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';

and then write in script month(Datefield) as Month

hope it helps

techvarun
Specialist II
Specialist II

Try Mapping Load  ApplyMap

MapTable:

Mapping Load * inline

[

Month, MonthName

1,Jan

2,Feb

..

!2,Dec

];

Load ApplyMap('MapTable',Month) as Month, * from Table_Name;