Fine, your answer put me on the right track. Just a note: I can't override directly the compareMembers method without breaking things, because the original implementation relies on a *private* member variabile to control the sort direction (which is needed by the hierarchize and union methods). What's the point making a method protected and leaving private the members it requires to work? :)
Anyway I created a static utility method to perform the sort that is very similar to the compareMembers one. Thanks Cosma --- In flexcoders@yahoogroups.com, "sreeni_r" <[EMAIL PROTECTED]> wrote: > > The workaround for this problem would be to create a extended OLAPSet > and override/copy compareMembers code and modify it to compare the > displayName instead of name. > > --- In flexcoders@yahoogroups.com, "Cosma" <cosmacol@> wrote: > > > > Hi, > > > > I noticed that behavior.. the problem is that this will sort by the > > value of the "dataField" field, that usually is a numeric > identifier.. > > but the sort often must be done on its "descriptive" name, that is > the > > value actually shown to the users. > > > > --- In flexcoders@yahoogroups.com, "sreeni_r" <sreeni_r@> wrote: > > > > > > > > > Have you tried calling OLAPSet.hierarchize()? > > > > > > It returns a new OLAPSet in which the members are sorted. > > > > > > --- In flexcoders@yahoogroups.com, "Cosma" <cosmacol@> wrote: > > > > > > > > Hi, > > > > > > > > I'm trying to sort the results of my OLAPQuery, anyone has > tried to > > > do > > > > that? I can't find any info in the documentation. > > > > > > > > I verified that the order of the elements is based on the > OLAPSet > > > > contents for that axis. That is, if you manually build the > OLAPSet > > > > that you assign to the query axis, you will control the order. > > > > > > > > However, it is common to build the OLAPSet querying the cube > about > > > its > > > > dimensions and hierarchies. The cube will return the elements > > > without > > > > any special order, probably it creates its internal sets adding > > > > elements as these are read. > > > > > > > > Is there an easy way to sort an OLAPSet built this way? I mean, > > > > probably it is possible to get the tuples array from the > OLAPSet, > > > wrap > > > > it into an arraycollection, sort it providing a custom compare > > > > function and then build a new OLAPSet with the new tuples > array, but > > > > this is a little tricky - there should be an easier way.. any > ideas? > > > > > > > > Thank you > > > > Cosma > > > > > > > > > >