Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Manmeet
Contributor III
Contributor III

Splitting Month and Year from 'Monthyear' column

Manmeet_0-1666094314862.png

Hi All,

I need to fetch Month and Year seperately as a column from the given 'Fiscal Month' column.

Let me know your suggestions for the solution.

Thanks & Regards,

Manmeet Dhawan

Labels (5)
3 Solutions

Accepted Solutions
justISO
Specialist
Specialist

Hi, you can try to take left 3 symbols (as some months in your list is full month name, some are short 3 letter ones) as month and 2 right symbols as year and make date from them, like:

makedate('20'&right([Fiscal Month],2) , Month(Date#(left([Fiscal Month], 3), 'MMMM')) )

or if you need separately:

Year(makedate('20'&right([Fiscal Month],2)))

Month(Date#(left([Fiscal Month], 3), 'MMMM'))

 

View solution in original post

Manmeet
Contributor III
Contributor III
Author

Thanks for your suggestion, It worked

Thank you !!

View solution in original post

Manmeet
Contributor III
Contributor III
Author

Thanks for your suggestion, I tried ... This is also giving correct results.

Thank you !

View solution in original post

5 Replies
justISO
Specialist
Specialist

Hi, you can try to take left 3 symbols (as some months in your list is full month name, some are short 3 letter ones) as month and 2 right symbols as year and make date from them, like:

makedate('20'&right([Fiscal Month],2) , Month(Date#(left([Fiscal Month], 3), 'MMMM')) )

or if you need separately:

Year(makedate('20'&right([Fiscal Month],2)))

Month(Date#(left([Fiscal Month], 3), 'MMMM'))

 

Or
MVP
MVP

Adding to what was suggested by JustISO, Subfield([Fiscal Month],chr(39),1) and Subfield([Fiscal Month],chr(39),2) can be used to split up the two parts into a month name (textual) and a year (YY) field. Note that this assumes that you're using a regular single quote - if it's something else, you can replace the chr(39) with the appropriate character.

MarcoWedel

another solution might be:

Month(Date#([Fiscal Month],'MMM''YY'))

and

Year(Date#([Fiscal Month],'MMM''YY'))

 

 

MarcoWedel_1-1666122099426.png

 

hope this helps

Marco

Manmeet
Contributor III
Contributor III
Author

Thanks for your suggestion, It worked

Thank you !!

Manmeet
Contributor III
Contributor III
Author

Thanks for your suggestion, I tried ... This is also giving correct results.

Thank you !