Place a SUM of a selected column in an EASY CALENDAR region
PhilMan2Jan 17 2008 — edited Jan 20 2008Hello,
I'd like to SUM a particular field (SCHEDULE_TABLE.SCHEDULE_PERCENT_FORECAST)
And place it in EASY CALENDAR. The idea is that if a resource had 3 records in the SCHEDULE_TABLE for a given date, the sum of the 3 SCHEDULE_PERCENT_FORECAST fields would appear as a Display Value inside the cell of EASY CALENDAR.
I'm having trouble making this happen.
What I've tried thus far is to create an Item in the calendar region and called it: P2_RESOURCEPERCENTSCHEDULED. In that Item, I took a shot at the SQL for the "Source Value Or Expression" and made the source type = "PL/SQL or Expression or Function" The SQL currently reads:
select sum(SCHEDULE_TABLE.SCHEDULE_PERCENT_FORECAST) as "SCHEDULE_PERCENT_FORECAST"
from "SCHEDULE_TABLE" "SCHEDULE_TABLE"
where "SCHEDULE_TABLE"."RESOURCE_ID" = P2_RESOURCE_ID
and "SCHEDULE_TABLE"."THE_DATE" = 11-JAN-08
group by SCHEDULE_TABLE.SCHEDULE_PERCENT_FORECAST
The field P2_RESOURCE_ID is from another region of the page where the user has previously selected the Resource.
The field SCHEDULE_TABLE.THE_DATE is date field from the schedule table which should correspond to the date field in EASY CALENDAR. I used the value of 11-JAN-08 because I know I have 3 records for that date. I know the final SQL shouldn't look like that, but I didn't know how the SQL should look so that it would SUM for each date in the calendar.
I hope this explains the issue well enough. I appeciate your help.
Phil