diff --git a/src/FACT_jobs.jl b/src/FACT_jobs.jl index 5baeb2f4793dc264c5a95924c958c25c00519c82..54f00e96aa551552498b027cbbae0652a4a1b792 100644 --- a/src/FACT_jobs.jl +++ b/src/FACT_jobs.jl @@ -138,6 +138,11 @@ function eu_lfs(conn::MySQL.Connection, selection::Dict) query = "SELECT Nace as industry, ((EmpTh_Q1+EmpTh_Q2+EmpTh_Q3+EmpTh_Q4)/4)*1000 as jobs FROM LFS WHERE Year = $year AND GeoID = '$id';" # execute result = query_connection(conn, query) + if !("industry" in names(result)) + println("No data returned for query with GeoID = $full_id and Year = $year and AND Agglvl_code = $agglvl_code.") + # 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