# DataFrames.jl: keep group by result in every row

**URL:** <https://discourse.julialang.org/t/dataframes-jl-keep-group-by-result-in-every-row/34110>\
**Category:** General Usage\
**Tags:** dataframes\
**Created:** [February 3, 2020, 10:10am UTC](https://discourse.julialang.org/t/dataframes-jl-keep-group-by-result-in-every-row/34110 "2020-02-03T10:10:19Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [February 9, 2020, 12:24pm UTC](https://discourse.julialang.org/t/dataframes-jl-keep-group-by-result-in-every-row/34110/5 "2020-02-09T12:24:05Z")

</div>

I’ve just made a small macro package that approximates data.table syntax: [[ANN] FilteredGroupbyMacro.jl](https://discourse.julialang.org/t/ann-filteredgroupbymacro-jl/34373)

It has the assignment syntax you want as well, although it uses a join in the background. At least you don’t have to write that out.

Your example would be: (the grouping variable comes second)

```julia
@by d[!, :b, s := sum(:a)]

```

---

_[View the full topic](https://discourse.julialang.org/t/dataframes-jl-keep-group-by-result-in-every-row/34110)._
