What is the best approach to sort resultant columns
Lets say we have product catalogue which is having 60k products , now we have to show these products in the dashboard based on Units sold,Orders,Revenue,Customers,Add-to-carts,Cart abandonments,Views, ,Clicks,Click through rate,Cart through rate,Conversion rate,Inventory left,Average daily sales,Sales per view, Sales per click etc.
All these columns are derived from multiple tables after joining and by default it is sorted based revenue column.
Every table is having the projections created based on columns present on the table ,not on these derived columns.
Now from the dashboard user might performs sorting in any of these derived column . What is the best approach to sort the records.