Headcount forecast data with lookup expansion
CREATE VIEW vwheadcountforecast AS (
SELECT hcf.businessunitid,
bu.name AS businessunitname,
pg.businessunitid AS planninggroup_businessunitid,
hcf.planninggroup AS planninggroup_id,
pg.name AS planninggroup_name,
pgq.name AS planninggroup_queuename,
hcf.scheduleid,
sd.shorttermforecastid,
sd.description AS scheduledesc,
sd.published AS sched_published,
hcf.weekdate,
hcf.startdate,
hcf.startdateltc,
hcf.requiredperinterval,
hcf.requiredwithoutshrinkageperinterval,
hcf.updated
FROM ((((headcountforecastdata hcf
LEFT JOIN budetails bu ON (((hcf.businessunitid)::text = (bu.id)::text)))
LEFT JOIN scheduledetails sd ON (((hcf.scheduleid)::text = (sd.scheduleid)::text)))
LEFT JOIN planninggroupdetails pg ON (((hcf.planninggroup)::text = (pg.id)::text)))
LEFT JOIN queuedetails pgq ON (((pg.queueid)::text = (pgq.id)::text)))
)| Name | Type | Default | Nullable | Children | Parents | Comment |
|---|---|---|---|---|---|---|
| businessunitid | varchar(50) | true | Business Unit GUID | |||
| businessunitname | varchar(50) | true | Business Unit Name | |||
| planninggroup_businessunitid | varchar(50) | true | ||||
| planninggroup_id | varchar(50) | true | Planning Group GUID | |||
| planninggroup_name | varchar(100) | true | Planning Group Name | |||
| planninggroup_queuename | varchar(255) | true | Planning Group Queue Name | |||
| scheduleid | varchar(50) | true | Schedule GUID | |||
| shorttermforecastid | varchar(50) | true | Short-Term Forecast GUID | |||
| scheduledesc | varchar(400) | true | Schedule Description | |||
| sched_published | bit(1) | true | Is Schedule Published? | |||
| weekdate | timestamp without time zone | true | Week Date | |||
| startdate | timestamp without time zone | true | Start Date (UTC) | |||
| startdateltc | timestamp without time zone | true | Start Date (LTC) | |||
| requiredperinterval | numeric(20,2) | true | Required Per Interval | |||
| requiredwithoutshrinkageperinterval | numeric(20,2) | true | Required Without Shrinkage Per Interval | |||
| updated | timestamp without time zone | true | Last Updated |
| Name | Columns | Comment | Type |
|---|---|---|---|
| public.headcountforecastdata | 10 | BASE TABLE | |
| public.budetails | 4 | BASE TABLE | |
| public.scheduledetails | 12 | Schedule Details Lookup Data | BASE TABLE |
| public.planninggroupdetails | 12 | BASE TABLE | |
| public.queuedetails | 25 | Queue Lookup data | BASE TABLE |