December 2018
Beginner to intermediate
500 pages
12h 10m
English
One of the most useful commands is @where, which allows us to filter a data source so that only the elements that satisfy the condition are returned. Similar to @select, the condition can be any arbitrary Julia expression:
julia> @from p in shopping_list begin
@where p.qty < 2
@select p
@collect DataFrame
end
We get the following output:

Only bread has a qty smaller than 2.
Filtering can be made even more powerful by means of range variables. These act like new variables belonging to the query expression and can be introduced using the @let macro:
julia> @from p in shopping_list begin @let weekly_qty = 7p.qty @where weekly_qty > 10 ...
Read now
Unlock full access