Aggregate Model and Chart Date Axis

  • 1
  • Question
  • Updated 1 year ago
  • Answered
I've built my first aggregate model to deal with charting tons of records.  I have a custom object that has commission payments by month, so my model is just a sum of payments grouped by Date and Sales Agent.  It doesn't seem like the chart understands that the X axis is a date field type, and when I change the function to a Calendar Month or Fiscal month I only get 1, 2, 3... as labels and none of my users will know what that means.  On a regular model, they see 'Jan 2015' and we can do the additional date Granularities which is great.  Any way to adjust this formatting?
Photo of Chandra V

Chandra V, Champion

  • 6,966 Points 5k badge 2x thumb

Posted 4 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
This is an area we know needs to be improved.  We have run into exactly the same problem.  Here is the workaround we have implemented. 

1. Use XML to add a second Grouping on the Paid_Date__c.   You have to go to the XML to do this.  Sorry.   Find the PaidDate by Calendar Month line, copy it and change the second one to PaidDate by Calendar Year.   Here is xml from a page we have in our org. 



2. Use a template to define your axis.  This is what I've done. 




This produces a somewhat better chart. 




I understand that this is not optimal. Improving this is on our to do list.. You can use a before render snippet to replace the X Axis categories,  and use the skuid utilitiy "skuid.time.monthNames[value]" to replace the number with a name.  (See more here)   but that's more than I can get to today... 
Photo of Chandra V

Chandra V, Champion

  • 6,966 Points 5k badge 2x thumb
Thanks, this will be just fine!  Except my dates are not ordered in the chart.  Can you help me get that straight?

Photo of Chandra V

Chandra V, Champion

  • 6,966 Points 5k badge 2x thumb
I found a thread with how to order using dates on an aggregate model and got this working.  Thanks!
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Great! 
Photo of Andrew N

Andrew N

  • 1,178 Points 1k badge 2x thumb
I seem to be running into the same issue. This post is from 2 years ago, is this something that has been addressed in a recent version of Skuid or will I have to follow the instructions above?