11g
Hi There,
I had posted this query in the Application express forum, but I guess it really should have been posted in this forum, since its more of a sql question. Apologies if this is against the forum rules.
We have a pie chart in Application Express which has select like
select null, '0-10' Days , count(*) from table
union
select null, '11-20' Days, count(*) from table
union
select null, '21-30' Days, count(*) from table
union
select null, '>30' Days, count(*) from table
The 3d pie chart was showing the slices is the correct order 0-10, 11-20, 21-30, >30 but now shows it in random order.
Unfortunately, the charts in Apex have a restriction as far as the select statement is concerned, it should just have three values in the select statement, the first is a link (can be null), the second can be any column_name or description and the third a value like count, sum etc. Now, the above query is to get the count of sales in the mentioned number of days and so what is happening is that it is taking the values as character sorting and I think randomly sorting in the apex chart. Now, this works fine in SQL! So was wondering if anyone has any suggestions on how to maybe force the sorting on the second column (0-10, 11-20 etc). If I take those values as 010, 1120, 2130 3000, something like that(basically a number) it seems to work fine, but then those show up as labels on the chart which is not correct.
Any suggestions on how to get the order by working. I suspect since the Days column in the select is a Character column this issue is occurring, however, with the restrictions in the number of select items we can have in the Apex charts, was wondering how do you get the order by working?
Thanks,
Ryan