Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Loading month/year timestamp (01/2012, 02/2012..)

Hi,

I'm trying to load month/year format as datetime, so '01/2012' would become 01/01/2012 datetime.

However I don't quite understand why the following doesn't work

Test:

LOAD

  Amount,

  Date(MonthYear, 'MM/YYYY') as MyDate

INLINE [Amount, MonthYear

          1, 01/2012

          3, 01/2012

          4, 01/2012

          5, 01/2012

          6, 01/2012

          7, 01/2012];

I also trie the following

Date('01/' & MonthYear, 'DD/MM/YYYY') as MyDate

But that didn't work either.

What could be wrong with my load script?

Tags (2)
1 Solution

Accepted Solutions
MVP
MVP

Re: Loading month/year timestamp (01/2012, 02/2012..)

Hi

Use

Date(Date#(MonthYear, 'MM/YYYY')) as MyDate

Or, if you want to be more explicit:

MonthStart(Date#(MonthYear, 'MM/YYYY')) as MyDate

The Date() function formats the display format of a date. The Date#() function interprets a string value as a date.


Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
1 Reply
MVP
MVP

Re: Loading month/year timestamp (01/2012, 02/2012..)

Hi

Use

Date(Date#(MonthYear, 'MM/YYYY')) as MyDate

Or, if you want to be more explicit:

MonthStart(Date#(MonthYear, 'MM/YYYY')) as MyDate

The Date() function formats the display format of a date. The Date#() function interprets a string value as a date.


Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Community Browser