At run time, based on user behavior and history, I need to perform a sorting operation. In my case, SortByDate/SortByDemand/SortByConsumption will just return the string, or we can say order by clause(which can be complex).
In most of the forums, I have found Strategy pattern should be used for sorting.

I have attached the image for Strategy pattern here. Util class will call the object of one the three classes i.e SortByDate/SortByDemand/SortByConsumption
So every time a new method of sorting is defined, I need to change the util class and define a new Strategy.

If however I implemented it using factory, the util class just need to call the factory and it will take care of which class to call. So I think I should use factory.
However I have read that strategy is best pattern for such needs. Why is strategy pattern is better here?
Strategy is a pattern aimed at allowing you to add new (in your case sort) algorithms to your software without breaking the clients of the algorithms. It’s an investment in design complexity that will pay off if you need to add new algorithms without breaking your clients. Factory is a pattern that complements Strategy because the clients of the algorithm implementations should not know specifically which implementation they’re using (in terms of software classes). The factory instantiates the concrete implementations of the algorithm so the client can use them without knowing the details.
Here’s the static structure:

Here’s the dynamic: