Skip to content
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

Using cols() inside of a for loop #40

Open
mthelm85 opened this issue Jul 9, 2019 · 0 comments
Open

Using cols() inside of a for loop #40

mthelm85 opened this issue Jul 9, 2019 · 0 comments

Comments

@mthelm85
Copy link

mthelm85 commented Jul 9, 2019

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant