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: 
Bob07
Contributor II
Contributor II

Converting Date to MonthYear

Hi,

I have a date and time field. I want to convert the field to MonthYear and use it in a line chart. I used the expression below but the line chart is not showing the monthyear as expected. Can anyone help please. Thank you. 

LOAD
"Submission Date",
date(MonthStart(date#([Submission Date], 'DD/MM/YYYY hh:mm')), 'MMM-YYYY') as MonthYearEX,

Submission Date customer Amount Expected
30/01/2022 14:10 John Doe 23 Jan-22
01/08/2023 16:15 John Doe 56 Aug-23
02/07/2021 08:31 John Doe 42 Jul-21
02/03/2024 10:34 John Doe 87 Mar-24
02/06/2024 16:19 John Doe 26 Jun-24

Bob07_0-1715599570937.png

 

Labels (2)
1 Solution

Accepted Solutions
Enno86
Contributor III
Contributor III

Hi @Bob07 ,

you could also just use "MonthName(date#([Submission Date])"

This will give you the name of the Month as well.

Furthermore in the x-Axis definition, you need to deactivate the "continous" option. Then your dates should be all populated on one spot per each month.

View solution in original post

3 Replies
Enno86
Contributor III
Contributor III

Hi @Bob07 ,

you could also just use "MonthName(date#([Submission Date])"

This will give you the name of the Month as well.

Furthermore in the x-Axis definition, you need to deactivate the "continous" option. Then your dates should be all populated on one spot per each month.

BrunPierre
Partner - Master II
Partner - Master II

Try

Date(Floor(TimeStamp#([Submission Date] 'DD/MM/YYYY hh:mm')), 'MMM-YYYY')

 

Bob07
Contributor II
Contributor II
Author

Thank you. It worked when I deactivated the continuous option.