Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Extracting Month from Date present in XLS File

Hi all,

I have exported MongoDB collection into an xls file and i am using this as the data source for my project.Below is one of the rows of xls file

XXXXX,"XXXXX","SUCCESS",2013-03-21T02:58:07Z,"XXXXXX"

Now I want to extract only the month from "2013-03-21T02:58:07Z".Please suggest the appropriate function to use in load script.

1 Solution

Accepted Solutions
Sokkorn
Master
Master

Hi yomishra,

Try this one

Month(Left('2013-03-21T02:58:07Z',10)) ==> if doesn't work then use this

Month(Date(Date#(Left('2013-03-21T02:58:07Z',10),'yyyy-MM-dd')))

Regards,

Sokkorn

View solution in original post

6 Replies
Gysbert_Wassenaar

You can try: mid('2013-03-21T02:58:07Z',6,2) as Month


talk is cheap, supply exceeds demand
MayilVahanan

HI

Try like this

SubField('2013-03-21T02:58:07Z','-',2)

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Thanks Gysbert it worked. Is there any another function available through which i can convert this number into month name say for March it will be 3, for April it will be 4. Actually I want to Display Month Name not the number.Can you please suggest something on this also.

Not applicable
Author

Thanks Mayil it also worked .Can you please see my reply to Gysbert answer.

Sokkorn
Master
Master

Hi yomishra,

Try this one

Month(Left('2013-03-21T02:58:07Z',10)) ==> if doesn't work then use this

Month(Date(Date#(Left('2013-03-21T02:58:07Z',10),'yyyy-MM-dd')))

Regards,

Sokkorn

Not applicable
Author

Thanks Sokkorn!!!You answered exactly what i want .