Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a straight table, which has so many expressions.
I want to sort the table always with one expression value.
How can i do that using macro or any other method?
i have prev and next button implemented. Clicking that some expressions will be shown and others will be hidden.
so i want to sort the table based on a single expression always, even if it is hidden also.
If a user has changed the sort by clicking some column, then click on next button should retain the sort order back to the previous sort order.
How can we do that?
hi,
have u tried this:
1.goto sort tab
2. click on each dimension and expression and sort them by expression. put your expression in definition box...
if this will not work then please post your sample app and describe your issue in detail.
HTh
Sushil
Hi sushil,
I want to sort the table on clicking a button.
It should sort based on a single expression written in the chart always.
How to achieve that?
I used the below macro
Sub SortChart
Set ch = ActiveDocument.GetSheetObject("CH01")
ch.SortBy 8 '' this line specifies the expression to sort by
Set p = ch.GetProperties
Set dims = p.Dimensions
'' Dimensions start by 0
'' 0 = Disable sort
'' 1 = Sort ascending
'' -1 = Sort descending
i = dims.Item(0).SortCriteria.SortByNumeric
If i = 1 Then
dims.Item(0).SortCriteria.SortByNumeric = -1
Else
dims.Item(0).SortCriteria.SortByNumeric = 1
End If
ch.SetProperties p
End Sub
It works fine, but here i have given the sortby "8" th expression, but when i click the next button, it will hide first 10 expressions and shows the next 10 expressions. so that sort order changes for the 2nd "8" expression enabled.
But i want the sort to remain for the 1st "8th" expression in the table.
Hi,
Why do you want to use the macro, when same can be done by what Sushil has suggested.
The reason for not using macro is, they may and may not work on browser and can slow down your application if not used properly.
Regards,
Kaushik Solanki
Hi,
If it is mendetory to have button to sort your table. then try this.
1. create a variable: say--- vsort
2. in the sort tab for expression sort put some condition like: if(vsort=1,expression)
here expression is your expression on which you want to sort the table
3. creat a button and set the variable value 1 on click.
It is better to avoid macros..
HTH
Sushil
The problem is,
The user can sort the columns manually by double clicking columns.
Then the sort order will change, but i want the sort order should come back to previous state by clicking the "Next" button in my application qvw file.
Sushil,
I tried the method, it is not working in my file.
I change the sort order, by double clicking some other expression.
And i applied the sort expression for the dimension to sort in the table.
It is not sorting the dimension based on the expression value.
Please post the sample app.
It has the client data, so sorry i cannot post the file
Can you tell me how we can modify the above macro, so that we can achieve this on clicking the button.