Date Database function is not getting sorted in correct order

Hello Helical Team,

I am applying database function to the date column for formatting the x-axis labels. After applying the function, the dates are not sorted in the correct order.

After applying date format function:


How do I show the date on x-axis in the required format and also sort the dates in the correct order?

Thank You

1 Like

Hello Linapag,

This is happening because as soon as you apply a database function on the date, it will be converted to string/varchar. Sorting of the x-axis will take place by treating the date as a string.
Please apply the following script in JS editor:

var viz_Options = c.get(“viz_Options”);
viz_Options.chartOptions = {
	x: {
		type: ‘timeseries’;
			format: ‘%m-%d-%y’

For more details, refer to

Thank You
Team Helical