JuliaDBMeta.jl icon indicating copy to clipboard operation
JuliaDBMeta.jl copied to clipboard

Using cols() inside of a for loop

Open mthelm85 opened this issue 5 years ago • 0 comments

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

mthelm85 avatar Jul 09 '19 11:07 mthelm85