Grouping by month year orders my dates incorrectly

I have a table that uses an Oracle timestamp to store incidents, and want to generate a line graph that charts a separate line for each incident type.

In order to simplify my Xaxis labels, I've pulled the abbreviated month and year out into another column called month_year.

My problem is that grouping by month year orders my dates incorrectly (e.g. Feb 2016 sorts higher that Jan 2016, so I wind up with Dec 2015, Feb 2016, Jan 2016, Mar 2016 as my grouping - not what I want)

A view of the data with a simplified date field might be:
{
{ id:1, incident_type: "Critical",month_year: "Jan 2016", date_reported: "12/01/2016 09:30"},
{ id:2, incident_type: "Critical",month_year: "Feb 2016", date_reported: "24/02/2016 09:30"},
{ id:3, incident_type: "Minor",month_year: "Jan 2016", date_reported: "07/01/2016 09:30"},
{ id:4, incident_type: "Critical",month_year: "Mar 2016", date_reported: "17/03/2016 09:30"},
{ id:5, incident_type: "Major",month_year: "Feb 2...

OriginalPostID-202703

OriginalPostID-202703

  Discussion posts and replies are publicly visible

Parents
  • Not sure if I get your requirement correctly, but it seems that you are looking forward to create a line chart to display Incidents per month. If that is the case then, you can use a below code snippet and feed the code actual values to generate a line chart.

    =a!lineChartField(
    label: "Incidents per month",
    categories: {"Jan 2016", "Feb 2016", "March 2016"},
    series: {
    a!chartSeries(label: "Critical", data: {2,5}),
              a!chartSeries(label: "Major", data: {5,9}),
              a!chartSeries(label: "Minor", data: {7,10})
              },
    xAxisTitle: "Month",
    yAxisTitle: "Count",
    yAxisMax: 100,
    showLegend: true
    )

Reply
  • Not sure if I get your requirement correctly, but it seems that you are looking forward to create a line chart to display Incidents per month. If that is the case then, you can use a below code snippet and feed the code actual values to generate a line chart.

    =a!lineChartField(
    label: "Incidents per month",
    categories: {"Jan 2016", "Feb 2016", "March 2016"},
    series: {
    a!chartSeries(label: "Critical", data: {2,5}),
              a!chartSeries(label: "Major", data: {5,9}),
              a!chartSeries(label: "Minor", data: {7,10})
              },
    xAxisTitle: "Month",
    yAxisTitle: "Count",
    yAxisMax: 100,
    showLegend: true
    )

Children
No Data