create a variable and use it in sort expression.
create buttons or text boxes with trigger to set variable to what u want it to be...
Please attach a sample so that we can help u in the same.
Why do you want to do it from a button click - as Bill says double clicking the column head will re-sort - provided that you have a valid sort order ticked for all fields (eg. numeric or text).
If you want to use a button then you will have to use an Expression based sort. It may be that you put the same expression as you have for the main expression into the sort expression - or you could use something else.
As you can't change the Ascending/Descending option on the sort order in code you will need to build the sort order into your expression. If it is a numeric you could flip the order by adding your value onto a very big negative number - which is either there or not based on a variable.
To do this, create a button to flip the value of a variable (vSortFlag) between zero and one.
Make your expression something like:
(-999999999999999 * vSortFlag) + sum(Value)
Replace sum(Value) with your expression.
You will probably want to turn off Interactive Sort on the Sort tab. You will definitely want to turn off the Sort Indicator on the Presentation tab.
If you don't know how to create the buttons check this document:
Hope that helps,
I have trouble sorting a line chart based on Frequency - Ascending. On opening the qvw the order changes from Frequency - ascending to descending. Do you have any suggestion to fix this issue??