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!

How to show Values in stacked bar chart

PhilMan2Oct 19 2021

I'm using Apex 19.1 on an 18.c database.
I have a stacked bar chart with two series: Online and In-Person. Each have their own SQL.
Online SQL:

Select
     ls.prim_key
   , ls.weekday
   , to_char(ls.liturgy_date, 'MON-DD-YYYY') as "Liturgy_Date"
   , ls.count_online
   , 'Online' series
From 
     LITURGY_STATS ls
Where
   ls.prim_key is not null And
   ls.liturgy_date > to_date('01-JAN-2021', 'dd-mon-yyyy') And
   ls.weekday in ('Sat', 'Sun')
Order by
   ls.liturgy_date;

In-Person SQL:

Select
     ls.prim_key
   , ls.weekday
   , to_char(ls.liturgy_date, 'MON-DD-YYYY') as "Liturgy_Date"
   , ls.count_in_person
   , 'Online' series
From 
     LITURGY_STATS ls
Where
   ls.prim_key is not null And
   ls.liturgy_date > to_date('01-JAN-2021', 'dd-mon-yyyy') And
   ls.weekday in ('Sat', 'Sun')
Order by
   ls.liturgy_date;

The difference between the two queries is ls.count_onilne and ls.count_in_person.
This produces the following stacked bar chart. I'd like to change the results. For each bar, I'd like to see the count_online, count_in_person and All Attendees. The All Attendees value would be something like:

 nvl(ls.count_in_person, 0) + nvl(ls.count_online,0 ) as "All Attendees"

How can I get all three values to show up for each bar?
Bar Chart Question.jpg (221.49 KB)

Comments

3474044
Answer

SOLVED:

Solution:

Add the following to SQL Workshop ---> SQL SCRIPTS ---> CREATE --> RUN

DELETE YOURS_TABLE_NAME WHERE EMTY_COLUMN_NAME IS NULL;
Marked as Answer by 3474044 · Sep 27 2020
1 - 1

Post Details

Added on Oct 19 2021
0 comments
279 views