Chart macro: Error with chart data 'XX' could not be converted to date

Hi all,
I have a series of MySQL queries in Confluence, and I'm using a time series chart with them.

I updated some of the code, and now all of the charts are broken, with the error "'2012 May' could not be converted to date". There is one chart that is unbroken, but when I copy the exact code, that duplicate code then has a broken chart. It's quite confusing.

I've posted the code below, along with the exact error. It's supposed to count up new plans sold, and display in a graph by month. Please help!
Please note: "Event_date" is in format "2012-05-09 10:12:40"
Chart macro: Error with chart data
'2012 May' could not be converted to date.
<<<START CODE>>> (Note: Some sensitive data scrubbed)
{chart:type=timeSeries|timePeriod=Month|columns=1,2,3,4,5|dateFormat=yyyy MMMM|dataOrientation=vertical|dataDisplay=true|legend=true|width=1000|height=300|opacity=90}

CONCAT(Year, ' ', Month) AS "Month",
`Plan 1`,
`Plan 2`,
`Plan 3`,
`All Plans`

select year(event_date) as "Year", Monthname(event_date) as "Month",
sum(if(plan_id = 1,1,0)) as "Plan 1",
sum(if(plan_id = 2,1,0)) as "Plan 2",

sum(if(plan_id = 3,1,0)) as "Plan 3",
sum(if(plan_id in(1,2,3),1,0)) as "All Plans",


where event_type = "create"
group by 1,2
order by 1 desc, month(event_date) desc

) formatting

<<<END CODE>>>

1 answer

Perhaps this was just you copying into the question, but don't split dateFormat across 2 lines.

Yea the code is "dateFormat=yyyy MMMM"...think the copy & paste here wrapped it.

Create a chart macro example with with just a row or 2 of regular data copy/pasted from the sql to show a simple version of your problem so it can be reproduced easily.

Problem fixed. Your initial hunch was right. There was a line break in dateFormat. But, in the Confluence editor, it was appearing as a space, so it wasn't clear there was a line break.

The text editor here picked it up, but I thought that was just text box wrap.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Tuesday in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

183 views 2 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you