Script to get the Frequency Rates Module View
"/*
This query is to pull out data as how it is displayed in the Frequency Rates module
*/
select
dou.OrgUnitName as [Business Unit]
,dent.EntityName as [Project]
,det.EntityTypeName as [Entity]
,dehw.Month as [Month]
,dehw.Year as [Year]
,dehw.Hours as [Hours]
,dehw.NumberOfWorkers as [Number of Workers]
,dht.HoursTypeName as [Classification]
from DimEntityHoursWorked dehw
left join DimOrgUnit dou on dou.DimOrgUnitId = dehw.DimOrgUnitId
left join DimEntity dent on dent.DimEntityId = dehw.DimEntityId
left join DimHoursType dht on dht.DimHoursTypeId = dehw.DimHoursTypeId
left join BridgeEntityEntityType bet on bet.DimEntityId = dent.DimEntityId
left join DimEntityType det on det.DimEntityTypeId = bet.DimEntityTypeId
group by
dou.OrgUnitName
,dent.EntityName
,dehw.Month
,dehw.Year
,dehw.Hours
,dehw.NumberOfWorkers
,dht.HoursTypeName
,det.EntityTypeName
order by dehw.Year, dehw.Month, dou.OrgUnitName"