W
workweek
How do you do a sum on top of a group by or how do you combine an if
statement with a group by? My code looks like this:
SELECT t_Starts_AppFlow.[Organization Level 1 : R],
t_Starts_AppFlow.[Location Level 3 : R], t_Starts_AppFlow.[EEO/AAP],
Count(t_Starts_AppFlow.[Step Name : CSW]) AS Hire,
Sum(t_Starts_AppFlow!Female) AS [Hire Female], Sum(t_Starts_AppFlow!POC) AS
[Hire POC], Sum(t_Starts_AppFlow!Manager) AS [Hire Manager],
Sum(t_Starts_AppFlow![Non-Manager]) AS [Hire Non-Manager],
Sum(t_Starts_AppFlow!Engineer) AS [Hire Engineer],
Sum(t_Starts_AppFlow![Non-Engineer]) AS [Hire Non-Engineer],
Sum(IIf(t_Starts_AppFlow![Internal Application] Not Like "",1,0)) AS [Hire
Total Applicants], Sum(t_Starts_AppFlow!Internal) AS [Hire Internal],
Sum(t_Starts_AppFlow!External) AS [Hire External]
FROM t_Starts_AppFlow
GROUP BY t_Starts_AppFlow.[Organization Level 1 : R],
t_Starts_AppFlow.[Location Level 3 : R], t_Starts_AppFlow.[EEO/AAP],
t_Starts_AppFlow.[Step Name : CSW]
HAVING (((t_Starts_AppFlow.[Step Name : CSW])="Hire"));
I need a sum by the Organization Level 1 : R.
statement with a group by? My code looks like this:
SELECT t_Starts_AppFlow.[Organization Level 1 : R],
t_Starts_AppFlow.[Location Level 3 : R], t_Starts_AppFlow.[EEO/AAP],
Count(t_Starts_AppFlow.[Step Name : CSW]) AS Hire,
Sum(t_Starts_AppFlow!Female) AS [Hire Female], Sum(t_Starts_AppFlow!POC) AS
[Hire POC], Sum(t_Starts_AppFlow!Manager) AS [Hire Manager],
Sum(t_Starts_AppFlow![Non-Manager]) AS [Hire Non-Manager],
Sum(t_Starts_AppFlow!Engineer) AS [Hire Engineer],
Sum(t_Starts_AppFlow![Non-Engineer]) AS [Hire Non-Engineer],
Sum(IIf(t_Starts_AppFlow![Internal Application] Not Like "",1,0)) AS [Hire
Total Applicants], Sum(t_Starts_AppFlow!Internal) AS [Hire Internal],
Sum(t_Starts_AppFlow!External) AS [Hire External]
FROM t_Starts_AppFlow
GROUP BY t_Starts_AppFlow.[Organization Level 1 : R],
t_Starts_AppFlow.[Location Level 3 : R], t_Starts_AppFlow.[EEO/AAP],
t_Starts_AppFlow.[Step Name : CSW]
HAVING (((t_Starts_AppFlow.[Step Name : CSW])="Hire"));
I need a sum by the Organization Level 1 : R.