Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
vikasshana
Creator II
Creator II

How to get Year and Month from Fiscal Period ID

Hi,

I've data like below

Fiscal Period
2023001
2023002
2023003
2023004
2023005
2023006
2023007
2023008
2023009
2023010
2023011
2023012

 

Now I would like to split the column into two i.e. Year and Month like below

Year Month
2023 1
2023 2
2023 3
2023 4
2023 5
2023 6
2023 7
2023 8
2023 9
2023 10
2023 11
2023 12

 

Any Idea how to achieve it?

Regards,

V

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

Year(Date#([Fiscal Period], 'YYYYMM')) as Year

Month(Date#([Fiscal Period], 'YYYYMM')) as Month

Note: Don't worry about the additional zeroes in between. As long as they are zeroes, qlik would intelligently bypass them.

View solution in original post

4 Replies
tresesco
MVP
MVP

Try like:

Year(Date#([Fiscal Period], 'YYYYMM')) as Year

Month(Date#([Fiscal Period], 'YYYYMM')) as Month

Note: Don't worry about the additional zeroes in between. As long as they are zeroes, qlik would intelligently bypass them.

jayshrinipurte
Partner - Creator
Partner - Creator

Hello,

 

You can use Right([Fiscal Period],4) as Year and Date(Left([Fiscal Period],2),'M') as Month

 

Regards,

Jayshri

vikasshana
Creator II
Creator II
Author

Perfect, thank you.

vikasshana
Creator II
Creator II
Author

Thank you Jayshri.