I'm trying to create a bar chart (with Oracle Apex v21.1.0) showing employee absences broken down by days of the week. i.e. a count of absences for each day of the week. I'm having problems getting the 7 bars for the days of the week to show in chronological order. This is my SQL:
-- sql for chart showing count of days absent for each day of week
select
TO_CHAR(ABD_DATE, 'D') as Day_Index_DOW,
TO_CHAR(ABD_DATE, 'DY') as Day_Name_DOW,
COUNT(TO_CHAR(ABD_DATE, 'D')) as Count_DOW
from F_ABSENT_DAYS
where ABD_EMP_ID = :P410_EMP_ID
group by TO_CHAR(ABD_DATE, 'D'), TO_CHAR(ABD_DATE, 'DY')
order by TO_CHAR(ABD_DATE, 'D')
Chart settings are:
Series Name is set to Day_Index_DOW
Label is set to Day_Name_DOW
Value is set to Count_DOW
This produces the 7 bars with the correct counts for the days of week. The problem is, they are sorted in alphabetical order (FRI, MON, SAT...). I'm trying to get them in chronological order (MON, TUE, WED...).
Is the error in the SQL or a setting in the designer?

