Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
FACT Data API Reader
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FACT
FACT Utils
FACT Data API Reader
Commits
1e106c45
Commit
1e106c45
authored
1 year ago
by
Riccardo Boero
Browse files
Options
Downloads
Patches
Plain Diff
Added management of missing data in all employment data queries
parent
93571b74
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/FACT_jobs.jl
+12
-2
12 additions, 2 deletions
src/FACT_jobs.jl
with
12 additions
and
2 deletions
src/FACT_jobs.jl
+
12
−
2
View file @
1e106c45
...
...
@@ -139,9 +139,9 @@ function eu_lfs(conn::MySQL.Connection, selection::Dict)
# execute
result
=
query_connection
(
conn
,
query
)
if
!
(
"industry"
in
names
(
result
))
println
(
"No data returned for query with GeoID =
$
id and Year =
$
year."
)
println
(
"No data returned for query with GeoID =
$
id and Year =
$
year."
)
# Initialize `result` with the expected columns but no rows
#
result = DataFrame(industry = String[], jobs = Float64[], geo_id = String[], agg_level = Int[])
result
=
DataFrame
(
industry
=
String
[],
jobs
=
Float64
[],
geo_id
=
String
[],
agg_level
=
Int
[])
end
# add geo_id col
result
[
!
,
:
geo_id
]
=
fill
(
id
,
nrow
(
result
))
...
...
@@ -178,6 +178,11 @@ function eu_sbs(conn::MySQL.Connection, selection::Dict)
query
=
"SELECT Nace as industry, Employment as jobs FROM SBS WHERE Year = "
*
string
(
year
)
*
" AND GeoID = '"
*
id
*
"';"
# execute
result
=
query_connection
(
conn
,
query
)
if
!
(
"industry"
in
names
(
result
))
println
(
"No data returned for query with GeoID =
$
id and Year =
$
year."
)
# Initialize `result` with the expected columns but no rows
result
=
DataFrame
(
industry
=
String
[],
jobs
=
Float64
[],
geo_id
=
String
[],
agg_level
=
Int
[])
end
# add geo_id col
result
[
!
,
:
geo_id
]
=
fill
(
id
,
nrow
(
result
))
# add agg level
...
...
@@ -213,6 +218,11 @@ function eu_rea(conn::MySQL.Connection, selection::Dict)
query
=
"SELECT Nace as industry, EmpTh*1000 as jobs FROM REA WHERE Year = "
*
string
(
year
)
*
" AND GeoID = '"
*
id
*
"';"
# execute
result
=
query_connection
(
conn
,
query
)
if
!
(
"industry"
in
names
(
result
))
println
(
"No data returned for query with GeoID =
$
id and Year =
$
year."
)
# Initialize `result` with the expected columns but no rows
result
=
DataFrame
(
industry
=
String
[],
jobs
=
Float64
[],
geo_id
=
String
[],
agg_level
=
Int
[])
end
# add geo_id col
result
[
!
,
:
geo_id
]
=
fill
(
id
,
nrow
(
result
))
# add agg level
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment