You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the order property only works for single column.
Let's say we would want to order by the difference of two numeric columns. Consider a Product table with price and discount columns. Seems like we cannot order by price - discount directly. I know we could have a modifier adding a new netPrice column with the difference, but sometimes we want to do this type of order without having to change the original model.
From looking at the code I see that applyOrder is splitting the string by , and only considering the first item. In the example above price - discount only takes price for parsing and ignores the rest.
@jeff3yan please let me know if it makes sense and I can work on a PR for this. I guess we would have to extract the columns and would parse each one individually and then combine them.
The text was updated successfully, but these errors were encountered:
Currently the
order
property only works for single column.Let's say we would want to order by the difference of two numeric columns. Consider a
Product
table withprice
anddiscount
columns. Seems like we cannot order byprice - discount
directly. I know we could have a modifier adding a newnetPrice
column with the difference, but sometimes we want to do this type of order without having to change the original model.From looking at the code I see that
applyOrder
is splitting the string by,
and only considering the first item. In the example aboveprice - discount
only takesprice
for parsing and ignores the rest.@jeff3yan please let me know if it makes sense and I can work on a PR for this. I guess we would have to extract the columns and would parse each one individually and then combine them.
The text was updated successfully, but these errors were encountered: