Highcharts - Categories and Series alignment - mysql

I have a MySQL table containing some data with the following format:
Year, Month, Value
2012, Nov, 33
2012, Dez, 34
2013, Jan, 35
...
2013, Dez, 40
and so on...
I want to do a column chart, where my categories are the Months (from Jan to Dez) and where I plot my data, [2012, 33], [2012, 34], etc.
I'm retrieving my data from MySQL with a group_concat from values, by year.
The problem: When I plot my data, if I have information to every month of every Year (since my categories go from Jan to Dez for some year at least) everything goes OK. But, if like in 2012, where I only have data for Nov and Dez, my chart gets messed up because the data is assumed as being from Jan and Fev (for example).
How can I solve this? There must be a better way than adding zeros to the string data I suppose. Maybe a different type of MySQL query? Or plotting data differently?
I appreciate any thoughts on this!
Thanks!

Related

RDLC Report - Ordering in date is not working

I am trying to implement ordering by date in rdlc report. The data is filtered on the basis of from date and to date. I have also added header on the top of the report as 'Month Name' Details(e.g. Nov Details)
The date format of a column on which I am using order by is 'MM/dd'.
I am passing below parameters -
From date -> 01-Nov-2020, To Date -> 28-Feb-2021
and I am getting data as Jan 2021, Feb 2021, Nov 2020, Dec 2020, which is wrong.
I want the output as Nov 2020, Dec 2020, Jan 2021, Feb 2021 and so on in the report.
I tried making changes in expressions and changed format in stored procedure also but its not working.
Please provide a solution.
In a tablix data region, set the sort expression for the data region or for each group, including the details group.
use direct date field in sort expressions or use below expression
=Cint(Format(Fields!DateField.Value, "yyyyMMdd"))

Matrix colum headers in Monthly order

I'm using a matrix and I would like my Month column headers to be in fiscal order...so April,May,June, July etc
I have looked at various answers about adding a calculated field but this only seemed to work for rows. I'm using Report Builder 3. Would appreciate some help please.
You can use something like:
=iif(datepart(DateInterval.Month, Fields!DateCompleted.Value) < 4, datepart(DateInterval.Month, Fields!DateCompleted.Value) + 12, datepart(DateInterval.Month, Fields!DateCompleted.Value))
This will add 12 to any month before April, making January month 13 and so on. Just use that in your sort order.

Graph - just show last 12 months

I have a line graph in my report.
My report has no parameters on it.
What I ideally want it to do is if I run the report today (May) it will only show me the last 12 months so May to May.
At the moment it is including April from last year as well, so would want that excluded. If I run it in two months time in July I would want it to only show July to July.
Hi,
The key here is the DatePaid field. This is the date that drives the graph.
The graph gets the Financial Year and Month from a date table.
The plots on the graph use an expression -
[code="other"]=SUM(IIF(Fields!InvoicePaid_.Value = "Yes" And Fields!PaidTarget.Value = "InTarget",1, 0))/Count(IIF(Fields!InvoicePaid_.Value = "Yes", 1, Nothing))[/code]
This allows a % to be calculated on the graph series you see above, to just show invoices that have been paid and are in target.
The report uses TSQL and I'm wondering if there is a flag I can place against any invoice that was paid 12 months ago. And then via a filter remove them from the graph?
So today date is 02/06/2015. I would want to mark all invoices with a flag upto 01/06/14 so they all appear on the graph - but May and April 2014 would be excluded.
Then when I run the report next month say - 7th of July 2015 - June 2014 will no longer appear on the graph but the 01/07/2014 and onwards would?
Hope that makes sense.

Filter "between" certain dates with dates stored as text values

I have SSRS Report with a text field MonthYear, containing values like "September 2012", "October 2012", etc.
I need to do a "between" filter, for example September 2012 - February 2013.
However, it seems to be imposible to do this any easy way, because this fields are in text format. I think that I have to convert this field to an integer format and then filter, but I don't know how.
I tried this. I used Replace function for every month, matching them to 1, 2, 3 etc. And make the filter using this numbers, so it was like "between 1 and 4" But somehow this doens`t work correctly. When i choose "Between September 2012(1) and March 2012(3)" it shows me all data for all monthes. But it seems that "Between May 2012(5) and August 2012(8)" works correctly..

XY-Scatter Chart In SSRS Won't Display Points

I'm a bit confused with this one.
I have a Dataset with a BackupDate and a BackupTime as well as a BackupType. The BackupDate is comprised of 12 characters from the left of a datetime string within a table. The BackupTime is comprised of 8 characters from the right of that same datetime string. So for example: BackupDate would be 'December 12 2008' and the BackupTime would be '12:53PM.'
I have added an XY-scatter chart to the report. I've added a 'series' value for the BackupType (so one can distinguish between a Full/Incr/Log backup). I've added a category value of BackupDate and set the Scale for the X-axis from the Min of BackupDate to the Max of BackupDate. I've then added an item to the Values with the Y variable set to BackupTime and the X variable set to BackupDate. The interval for the Y-axis is 12:00AM to 11:59PM and the formatting for the labels is 'hh:mmtt'.
The BackupTime matches the format of the Y-axis. The BackupDate matches the format of the X-axis. 10 entries are retrieved by my Dataset and the Legend is properly populated by the BackupType field.
No points are being plotted on the graph and no markers/pointers are shown if they are enabled. There should be a point on the graph for every point in time of each day there is a backup of a specific type.
Am I missing something? Does anyone know of a good tutorial dealing specifically with XY-scatter graphs and using them in a way I intend?
I am using the 2005 version of SSRS rather than the 2008 version.
Screenshot of what my chart currently looks like:
In case it could be dataset related:
SELECT TOP (10) backup_type, LTRIM(RTRIM(LEFT(backup_finish_date,
12))) AS BackupDate, LTRIM(RTRIM(RIGHT(backup_finish_date, 8))) AS BackupTime
FROM DBARepository.Backup_History
As requested, here are the results of this query. There is a Where clause to constrain the results to a specific database of a specific server that was not included in the above SQL Query.
Log Dec 26 2008 12:00PM
Log Dec 27 2008 4:00AM
Log Dec 27 2008 8:00AM
Log Dec 27 2008 12:00PM
Log Dec 27 2008 4:00PM
Log Dec 27 2008 8:00PM
Database Dec 27 2008 10:01PM
Log Dec 28 2008 12:00AM
Log Dec 28 2008 4:00AM
Log Dec 28 2008 8:00AM
As the data grows, the scatter chart avoids X-axis values if it extends the (floating/numeric) limitations
Open the chart properties->X-Axis tab->Minor tick mark->Numeric or time-scale values...
It should solve your problem.