Nested Query And Order On Calculated Column

how can I use query builder to do something like this?

select (some operation on row) as Value, id

from (select * from …table… where. .condition…)

order by Value asc limit 0, 20

Thank you