# Does Query.jl have a good way to implement mutations that depend on each other?

**URL:** https://discourse.julialang.org/t/does-query-jl-have-a-good-way-to-implement-mutations-that-depend-on-each-other/44643
**Category:** Data
**Created:** [August 9, 2020, 9:25pm UTC](https://discourse.julialang.org/t/does-query-jl-have-a-good-way-to-implement-mutations-that-depend-on-each-other/44643 "2020-08-09T21:25:09Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)
#### Post date: [August 10, 2020, 9:35pm UTC](https://discourse.julialang.org/t/does-query-jl-have-a-good-way-to-implement-mutations-that-depend-on-each-other/44643/3 "2020-08-10T21:35:57Z")

</div>

I would write this as

```julia
DataFrame(bad=[1,2], good=[0, 3]) |>
@mutate(count = _.bad + _.good) |>
@mutate(bad_rate = _.bad/_.count) |>
@mutate(bad_pct =round(_.bad_rate*100;digits=1))

```

---

_[View the full topic](https://discourse.julialang.org/t/does-query-jl-have-a-good-way-to-implement-mutations-that-depend-on-each-other/44643)._
