assuming i was running a rails shop app that sells products.
i wanted to create a segment in products table that shows the most sold items. unfortunately i don’t have a column that shows how many times an item has been sold so i need to create a smart segment that counts how many times an item has been sold from the log table.
doing that is possible but i wanted to show the items in order from most sold to least and my SQL query does return them in that order but unfortunately when displayed they’re not in that order.
i would appreciate it if someone could help me with this. if it is even possible.