I’m trying to bring the meanElapsed column to merge with the data table.
So it will be an extra column called meanElapsed with its same value on each row.
How?
I also added an x column on both tables to make them both have a common column and values. I don’t know if it helps.
Here is a query that I tried.
join.left(
left: data,
right: calculatedValue,
on: (l, r) => l.x == r.x,
as: (l, r) =>
({
l with meanElapsed: r.meanElapsed
})
)
But the output table has the meanElapsed column empty
Can you please post your full Flux queries for data table and calculatedValue table? You may not need to do a join, but instead use a pivot(). Will help tremendously to see the two queries.
Hi @AAron your first code doesn’t look wrong but try adding a |> group() at the end of each table, and just to br clear on what to expect, join.left will take all the rows on the left column and if there is a match based on the column condition used it will ad the entries of the right column.
Hard to tell what to expect whitout actually seeing both tables, and also there are 2 types of joins.
If you use import “join” there are more functions in that library (left, right, inner, outter), but you can not use the simpler join() wich if i remember correctly is an inner join
The explanation:
In the join functions you need to have the same schema usinf |> group () removes any grouping.
If I am correct, when you used keep you dropped some grouping columns so now your 2 data sets have different schemas.
Thanks! The meanElapsed column is populated after adding the group() function to the data table. Still not entirely sure why it started to work, since there is no keep() function in my data table.