Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

Month

Hi

In my data table I have following field

Month_Year

JAN_2014

FEB_2014

.......

In my load load script I want to load two separate fields Month and Year

Pls help me to write script

3 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

year(date#(Month_Year,'MMM_YYYY')) as Year

month(date#(Month_Year,'MMM_YYYY')) as Month


-Rob

upaliwije
Creator II
Creator II
Author

Thanks it is working. I forgot to tell you I want extract month number like 1,2,3

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Month returns a dual, which is both a number and a string. The string will be used for display and the number used automatically for sorting and arithmetic.

you can explicitly extract the number of the month by adding a num() function.

num(month(date#(Month_Year,'MMM_YYYY'))) as Month


-Rob

http://masterssummit.com

http://robwunderlich.com