Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
stjernvd
Partner - Creator
Partner - Creator

Convert String to Date and break down into Day, Month, Year

Hi,

I am having trouble converting my date string into a proper qlikview recognizable date, these are my dates:

20110418
20150312
20150819
20150827
20150430
20150223
20150729

I used this in the script to convert them to a more readable date:

Date(Date#(date,'YYYYMMDD'),'DD-MM-YYYY') as [Date]

and I got this:

18-04-2011

12-03-2015

and so on...

However, when I want to create a day, month, year dimension to have as list boxes using this function it doesn't work:

Month([Date]) as Month,

In my list box the month doesn't match up to the date in the table...when I press June in my list box, the June dates are not filtered for in my bigger table.

How do I fix this?

1 Solution

Accepted Solutions
ger_alegria
Partner - Creator
Partner - Creator

Try with:

Month(Date(Date#([Last Activity Date],'YYYYMMDD'),'DD-MM-YYYY') ) as Month

Day(Date(Date#([Last Activity Date],'YYYYMMDD'),'DD-MM-YYYY') ) as Day

Year(Date(Date#([Last Activity Date],'YYYYMMDD'),'DD-MM-YYYY') ) as Year


Let me Know if it works.


Ger Alegría.

View solution in original post

3 Replies
ger_alegria
Partner - Creator
Partner - Creator

Try with:

Month(Date(Date#([Last Activity Date],'YYYYMMDD'),'DD-MM-YYYY') ) as Month

Day(Date(Date#([Last Activity Date],'YYYYMMDD'),'DD-MM-YYYY') ) as Day

Year(Date(Date#([Last Activity Date],'YYYYMMDD'),'DD-MM-YYYY') ) as Year


Let me Know if it works.


Ger Alegría.

stjernvd
Partner - Creator
Partner - Creator
Author

It works thank you so much for your help, I was struggling with this for a while!!

MarcoWedel

move your line

Month([Last Activity Date]) as Month,

to a preceding load


regards


Marco