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: 
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

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

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
MVP
MVP

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
Champion III
Champion III

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
MVP
MVP

Not a problem

maxgro
MVP
MVP

try

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