Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Create Date Field Using Numeric Year and Alpha Month Name

Inputs

Month: Apr

Year: 2015

Desired output: 201504

Current syntax:

Num(Year & num(month(date#(Month,'MMM'))), '000000') as [Fiscal Period]

Current output: 020154

I'm very close but I cant seem to figure out where I am going wrong.

Any help is appreciated.

- dave

1 Solution

Accepted Solutions
sunny_talwar

Try this:

Date(MakeDate(Year, Month(Date#(Month, 'MMM')), 1), 'YYYYMM') as [Fiscal Period]


or


Date(Date#(Year & '-' & Month, 'YYYY-MMM'), 'YYYYMM') as [Fiscal Period]

View solution in original post

5 Replies
sunny_talwar

Try this:

Date(MakeDate(Year, Month(Date#(Month, 'MMM')), 1), 'YYYYMM') as [Fiscal Period]


or


Date(Date#(Year & '-' & Month, 'YYYY-MMM'), 'YYYYMM') as [Fiscal Period]

swuehl
MVP
MVP

Try

Year & num(month(date#(Month,'MMM')), '00') as [Fiscal Period]


or


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


note that the underlying numeric value is differenct in the second approach (it's the monthstart date value)

Anonymous
Not applicable
Author

Amazing. Thank you per usual.

sunny_talwar

Not a problem

maxgro
MVP
MVP

try

Date(Date#(Year & Month, 'YYYYMMM'), 'YYYYMM')      as .......