# DataFrame join rename multiple columns in join command

**URL:** <https://discourse.julialang.org/t/dataframe-join-rename-multiple-columns-in-join-command/75574>\
**Category:** General Usage\
**Tags:** dataframes\
**Created:** [February 1, 2022, 12:41pm UTC](https://discourse.julialang.org/t/dataframe-join-rename-multiple-columns-in-join-command/75574 "2022-02-01T12:41:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![korilium](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/korilium/32/48714_2.png) [@korilium](https://discourse.julialang.org/u/korilium)\
**Post date:** [February 1, 2022, 12:41pm UTC](https://discourse.julialang.org/t/dataframe-join-rename-multiple-columns-in-join-command/75574/1 "2022-02-01T12:41:30Z")

</div>

So i want to outerjoin three dataframes and rename their columns at the same time.

Here is the code that I try to do

```julia
using DataFramesMeta, Dates, Plots, DataFrames, MarketData, PyCall

start = DateTime(2018,1,1)
IBCI = DataFrame(yahoo(Symbol("IBCI.DE"), YahooOpt(period1 = start)))
IUSA = DataFrame(yahoo(Symbol("IUSA.DE"), YahooOpt(period1 = start)))
IEMA = DataFrame(yahoo(Symbol("IEMA.AS"), YahooOpt(period1 = start)))

dollar_portfolio = outerjoin(IBCI[:,[:timestamp, :Open]],
                             IUSA[:,[:timestamp, :Open]],
                             IEMA[:,[:timestamp, :Open]],
                             on=:timestamp, makeunique=true, 
                             renamecols= "IBCI" => "IUSA"=> "IEMA")

```

This give me the following error

```julia
ERROR: LoadError: MethodError: no method matching outerjoin(::DataFrame, ::DataFrame, ::DataFrame; on=:timestamp, makeunique=true, renamecols="IBCI" => ("IUSA" => "IEMA"))
Closest candidates are:
  outerjoin(::AbstractDataFrame, ::AbstractDataFrame, ::AbstractDataFrame...; on, makeunique, validate, matchmissing) at C:\Users\ignac\.julia\packages\DataFrames\BM4OQ\src\join\composer.jl:1044 got unsupported keyword argument "renamecols"
  outerjoin(::AbstractDataFrame, ::AbstractDataFrame; on, makeunique, source, indicator, validate, renamecols, matchmissing) at C:\Users\ignac\.julia\packages\DataFrames\BM4OQ\src\join\composer.jl:1013
Stacktrace:
 [1] kwerr(::NamedTuple{(:on, :makeunique, :renamecols), Tuple{Symbol, Bool, Pair{String, Pair{String, String}}}}, ::Function, ::DataFrame, ::DataFrame, ::DataFrame)
   @ Base .\error.jl:163
 [2] top-level scope

```

If I only join two of them everything works fine. But I would like to join multiple at the same time. Does anyone knows how I should do this?  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [February 1, 2022, 1:02pm UTC](https://discourse.julialang.org/t/dataframe-join-rename-multiple-columns-in-join-command/75574/2 "2022-02-01T13:02:46Z")

</div>

column renaming is only supported if you do `outerjoin` for two data frames. If you have more than two and want column renaming then either:

1. rename columns before the operations
2. do sequential `outerjoin` of 2 data frames at a time
