-
Notifications
You must be signed in to change notification settings - Fork 0
[PULL REQUEST] add in military employment #245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You added a comment regarding "SE" being added, should probably also add a comment regarding "MIL" being added. |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will need to update source once table is moved |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| /* | ||
| This query grabs the Military Active Duty (Job) Data and assigns counts to MGRA15. | ||
| This will assign 0 to MGRAs where there is no Military Jobs | ||
| */ | ||
|
|
||
| -- Initialize parameters ----------------------------------------------------- | ||
| DECLARE @run_id INTEGER = :run_id; | ||
| DECLARE @year INTEGER = :year; | ||
|
|
||
|
|
||
| -- Send error message if no data exists -------------------------------------- | ||
| IF NOT EXISTS ( | ||
| SELECT TOP (1) * | ||
| FROM [ws].[fact].[MILITARY_EMPLOYMENT] | ||
| WHERE [year] = @year | ||
|
bryce-sandag marked this conversation as resolved.
|
||
| ) | ||
| BEGIN | ||
| THROW 50000, 'Military Active duty data does not exist.', 1; | ||
|
bryce-sandag marked this conversation as resolved.
|
||
| END | ||
| ELSE | ||
| BEGIN | ||
|
|
||
| -- Get MGRA Military Active Duty Counts ------------------------------------- | ||
| SELECT | ||
| @run_id AS [run_id], | ||
| @year AS [year], | ||
| [mgra], | ||
| 'MIL' AS [industry_code], | ||
| 'jobs' AS [metric], | ||
| COALESCE(SUM([site_active_duty]), 0) AS [value] | ||
| FROM [inputs].[mgra] | ||
| LEFT OUTER JOIN [ws].[fact].[MILITARY_EMPLOYMENT] | ||
| ON [MILITARY_EMPLOYMENT].[shape].STWithin([mgra].[shape]) = 1 | ||
| AND [run_id] = @run_id AND [year] = @year | ||
| WHERE [run_id] = @run_id | ||
| GROUP BY [mgra] | ||
| ORDER BY [mgra] | ||
| END | ||
Uh oh!
There was an error while loading. Please reload this page.