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

Charles Benkendorf May 8, 2012
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"
<<<START ERROR>>>
Chart macro: Error with chart data
'2012 May' could not be converted to date.
<<<END ERROR>>>
<<<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}
{sql-query:dataSource=XX\|output=wiki}

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

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",

FROM `XX`.`XX`

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

) formatting

{sql-query}
{chart}
<<<END CODE>>>

1 answer

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 8, 2012

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

Charles Benkendorf May 8, 2012

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

Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 13, 2012

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.

Charles Benkendorf May 13, 2012

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
TAGS
AUG Leaders

Atlassian Community Events