# JuliaDB: How to modify multiple existing columns with setcol using functions

**URL:** <https://discourse.julialang.org/t/juliadb-how-to-modify-multiple-existing-columns-with-setcol-using-functions/19847>\
**Category:** Data\
**Tags:** juliadb\
**Created:** [January 20, 2019, 7:21pm UTC](https://discourse.julialang.org/t/juliadb-how-to-modify-multiple-existing-columns-with-setcol-using-functions/19847 "2019-01-20T19:21:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pazzo83](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pazzo83/32/232_2.png) [@pazzo83](https://discourse.julialang.org/u/pazzo83)\
**Post date:** [January 20, 2019, 7:21pm UTC](https://discourse.julialang.org/t/juliadb-how-to-modify-multiple-existing-columns-with-setcol-using-functions/19847/1 "2019-01-20T19:21:45Z")

</div>

Hi, I am trying to modify several existing columns with one call to `setcol` using functions. Essentially I have a table where i need to divide 4 of the columns by 10 to get the proper value.

I know this is the proper syntax for modifying ONE column:  
`setcol(tbl, :TMAX, :TMAX => t -> t / 10)`

However, I need to do something like:  
`setcol(tbl, :TMAX => t -> t / 10, :TMIN => t -> t / 10)`

Any suggestions?

---

<div class="post-metadata">

**Author:** ![pazzo83](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pazzo83/32/232_2.png) [@pazzo83](https://discourse.julialang.org/u/pazzo83)\
**Post date:** [January 20, 2019, 10:13pm UTC](https://discourse.julialang.org/t/juliadb-how-to-modify-multiple-existing-columns-with-setcol-using-functions/19847/2 "2019-01-20T22:13:48Z")

</div>

So this solution worked, but I don’t know if there is anything more efficient (esp if you want to apply the _same_ function to multiple columns.

```julia
setcol(tbl, :TMAX => :TMAX => t -> t / 10, :TMIN => :TMIN => t -> t / 10, :TAVG => :TAVG => t -> t / 10, :PRCP => :PRCP => t -> t / 10)

```
