Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
I am guessing that you have two dimensions in your chart- > Month and Year? Try using this as your dimension -> Month & ' ' & Year
I am guessing that you have two dimensions in your chart- > Month and Year? Try using this as your dimension -> Month & ' ' & Year
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:
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.
Si Quieres que te Quede Como en El Gráfico solitario deberías dejan en Dimensiones mes y año por Separado.
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?
Change the dimension to this:
Date#(Month & ' ' & Year, 'MMM YYYY')
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')