Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Displaying months on the x-axis

I cannot seem to get a way to display months of the year along the x-axis.

When loading the data I extract the month from the date,

SUBSTRING(CONVERT(VARCHAR(11), DateCreated, 113), 4, 3) AS DateCreatedMMM,



so I have a field that holds the month e.g. Jan, Feb, Mar, etc

If I use the DateCreatedMMM field as the dimension for the graph, how do I get the months to always display in the order, Jan, Feb, Mar, Apr etc and not be sorted into different orders.

I tried formatting the field in the Document properties as DATE with a format of MMM but I still sometimes get the months out of order on the x-axis...depending on the values calculated for each month.

1 Solution

Accepted Solutions
deepakk
Partner - Specialist III
Partner - Specialist III

hi Mark,

YOu display Jan, feb on X Axis.. but in Sort tab (chart properties) -- there is expression box. Select it

and say = Monthnum ascending.

SO it will always disply

Jan Feb Mar in youe X axis.

View solution in original post

4 Replies
deepakk
Partner - Specialist III
Partner - Specialist III

hi Mark,

Create a Monthnum field as below

date(date#(SUBSTRING(CONVERT(VARCHAR(11), DateCreated, 113), 4, 3),'MMM'),'MM') AS MontNum,

this will give output as 01,02,03.

Now go to Sort tab in Chart and in Expression =MontNum;

I hope this helps.

Not applicable
Author

I already have a CreatedMonth field that stores the numeric equivalent for each month and I can use this to display 01 02 03.... along the x-axis but I'd like to display Jan Feb Mar...... I just can't see how I do that with the sorting or formating options .

deepakk
Partner - Specialist III
Partner - Specialist III

hi Mark,

YOu display Jan, feb on X Axis.. but in Sort tab (chart properties) -- there is expression box. Select it

and say = Monthnum ascending.

SO it will always disply

Jan Feb Mar in youe X axis.

Not applicable
Author

Thanks...thats it working now.