Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle Apex 20.1 Hierarchical Labeling Sort by Date

hiddenonearthFeb 23 2021 — edited Feb 23 2021

Hello,
for one of my charts I am using a hierarchical labeling to group values by month. When doing this I have to convert the date column to a string to group the values. Unfortunately, when doing so the x-axis gets sorted by the string and not by date (see picture).
Any idea on how to get the x-axis sorted by months ascending by year (i.e., 10/2020 then 02/2021).
My query:
select distinct to_char(branch) || '.' || lbl, val, series, user, start_date from (
select to_char(DATE, 'MM / YYYY') branch, DATE lbl, VALUE val, NAME series, USER user, DATE start_date
from TABLE
WHERE TABLE_ID = :PAGE_ID

)
ORDER BY 1 asc; // Here I tried different order by clauses with DATE, to_char(DATE, 'MM / YYYY'), start_date etc but with
not success

Thanks.

image.png

This post has been answered by Oleh Tyshchenko on Feb 23 2021
Jump to Answer
Comments
Post Details
Added on Feb 23 2021
3 comments
999 views