Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
I have two button one is for "ASC" & another is for "DESC". What I need is when I click on ASC button then in my bar chart data should be sorted into Alphabetical Order from A>B>.............Z & when I click "DESC" then it should be Z>>>>>Y.........................A
Need the same in a single chart. Right now am achieving the same by using "wild match" function with in Sort Expression.
Is there any other best way to achieve the same.
may be MACRO..
Can not use macro in our app
Could you share your sample data so that we can see any workaround??
By creating two charts; one ASC sorted and one DESC. Apply a conditional show one both graphs, triggered by your ASC and DESC buttons.
Cheers,
Michiel
Hi Neetu,
Yes, you could do this with an expression and a variable in your button.
The basic construct would need something like:
The fun bit will be deciding how to control the sort. That will depend on your data. The first thought that comes to mind is using a Dual() function. The second, would be using a pick(match()) array. Both of these should be set up in your script.
Hopefully that will get you started. If you get stuck, post here again and I'll go into more detail.
George
Sounds like cheating, possible maintenance issues if there are a lot of these, but sometimes the simplest solutions are the best!
Perhaps you can create a variabel vSortFactor. When you press DESC, set the variable to 1, when you press ASC, set the variabel to -1.
Then sort by the same expression as your main expression multiplied with the $(vSortFactor) and select order Descending.
Hi,
Hopefully this will help you.
Perfectly Sorting Pivot Table (by A-Z. y-Value set for each dim-level)
Regards
ASHFAQ
Hi Neetu,
Try this:
Make a variable, vSortOrder and set it to 1 initially.
Make a button with text
=if($(vSortOrder)=1,'ASC','DESC')
and with an action to set the variable vSortOrder = -$(vSortOrder).
Make a variable vAscending
Match(Field, $(=Chr(39) & concat({1} Distinct Field,chr(39) & ',' & Chr(39),Field) & Chr(39)))
but replace the word Field with the name of the field you are sorting on.
In your chart sort your field by the expression
=$(vSortOrder) * $(vAscending)
Regards