Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
TRY
month(date(AuditDate,'DD/MM/YYYY')) as AuditMonth
VIKAS
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
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
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
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;