# Query @select nested in a function

**URL:** <https://discourse.julialang.org/t/query-select-nested-in-a-function/45218>\
**Category:** New to Julia\
**Tags:** query\
**Created:** [August 19, 2020, 3:53pm UTC](https://discourse.julialang.org/t/query-select-nested-in-a-function/45218 "2020-08-19T15:53:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![elalaouifaris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elalaouifaris/32/17391_2.png) [@elalaouifaris](https://discourse.julialang.org/u/elalaouifaris)\
**Post date:** [August 19, 2020, 3:53pm UTC](https://discourse.julialang.org/t/query-select-nested-in-a-function/45218/1 "2020-08-19T15:53:38Z")

</div>

Hi,

I have an issue using Query @select using a function call parameter to select columns:

```julia
using Query, VegaDatasets

iris = dataset("iris")

iris |> @select(startswith("petal"))
# This works of course

function get_data(df, tag)
    df |>
        @select(startswith(tag)) |>
        collect
end

get_data(iris, "petal")
# All columns are removed

```

Is this an incorrect way of using the Query syntax?  
What is the recommended way for making such helper functions?
