Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Continuous Line Chart

Good Morning,

How do I create a line chart that will show months and years on the x-axis?

I want it to run Jan - Dec 2014 and the same for 2015, but I can only seem to make a graph that has the Jan - Dec axis, but then 2 lines for the year.

Thanks

Dan

1 Solution

Accepted Solutions

Re: Continuous Line Chart

I am guessing that you have two dimensions in your chart- > Month and Year? Try using this as your dimension -> Month & ' ' & Year

6 Replies

Re: Continuous Line Chart

I am guessing that you have two dimensions in your chart- > Month and Year? Try using this as your dimension -> Month & ' ' & Year

cjburrow
New Contributor III

Re: Continuous Line Chart

I would do it via a Month_Year field. So if you have a master calendar with individual dates you could create a field like this using the MonthName function:

MasterCalendar:

...

Date,

MonthName(Date) as MonthYear,

Year(Date) as Year...

Then you could have a line chart with MonthYear as the dimension and it would still respond to selections in the Year, Month, Date fields. Something like this:

2015-11-16_8-53-23.jpg

EDIT: in my App the MonthYear field is just named Month (x-axis in the picture). MonthName() by default will have this format: 'MMM YYYY'. I changed mine to 'MMM-YY' format.

promaniuk
New Contributor III

Re: Continuous Line Chart

Si Quieres que te Quede Como en El Gráfico solitario deberías dejan en Dimensiones mes y año por Separado.

Not applicable

Re: Continuous Line Chart

Hi Sunny,

Thanks that worked apart from the chart is now running in an incorrect order.

I have Jan - Dec 2015, Jan - Dec 2014

I want to have it the opposite so that Dec 14 joins to Jan 15.

I have tried to use the sort, but nothing seems to work.

Any ideas?

Re: Continuous Line Chart

Change the dimension to this:

Date#(Month & ' ' & Year, 'MMM YYYY')

cjburrow
New Contributor III

Re: Continuous Line Chart

That's because this Month & ' ' & Year is interpreted as text, not a dual date. You could try the suggestion from Sunny T using the Date#() function but I think you might get errors because you will be trying to assign a date value and only specifying a month and a year (with no day). If you are going to use that approach (instead of MonthStart() or MonthName()) then I would suggest this:

Date( Date#(1&' '&Month&' '&Year,'D MMM YYYY'), 'MMM YYYY')

Community Browser