JuliaDBMeta.jl
JuliaDBMeta.jl copied to clipboard
Using cols() inside of a for loop
When attempting to access columns via cols()
inside of a for loop, I get UndefVarError: i not defined.
function test(state::Int64, occ::Int64)
@applychunked tbl begin
@where !ismissing(:OCCP) &&
:ST == state &&
(:ESR == 1 || :ESR == 2) &&
:OCCP == occ
@groupby _ :PUMA { total = sum(:PWGTP), wgts = [sum(cols(Symbol("PWGTP$i"))) for i in 1:80] }
end
end