Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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

Labels (1)
3 Replies
rwunderlich
MVP
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
MVP
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