I don't understand why I can't do this but I'm having real difficulty getting this xaction to work.

I follows these pretty basic steps.
  1. User selects sales person
  2. User selects additional accounts
  3. Javascript adds these accounts to bottom of the xaction
  4. Report is displayed.
So I've been playing around for a week or so now and can't get it to work,
This is the portion of my query that needs manipulating.....
Code:
 UNION({TopPercent(Crossjoin([Sales Person.Sales Person].[All sales person].[{nameoutput}].Children,
{[Market Sector.Market Sector].[All Market Sector].Children}),
{percentage}, [Measures].[{ofwhat}])}, {Crossjoin({[Sales Person.Sales Person].[All sales person].[{nameoutput}].[{str_out}]}, {[Market Sector.Market Sector].[All Market Sector].[16]})}) 
ON ROWS
I want the additional accounts selected to get inserted
around the [{nameoutput}].[{str_out}] bit. I can work that out but what I can't do it get the information in the first place.
The additional accounts come from a SQL query and are dumped into a result-set.

I then use the result set to populate a secure filter so the user can select a number of additional accounts and I'd like them to be put in a second result-set or string list or anything I can use to read from memory.

As soon as I try and manipulate these sets or list with javascript it just throws a wobbly and I can't get any information out of it.

I can use basic variable stuff to add one extra account but not a random number of them. If someone can help me that would be great I'm absolutely stumped and can't get any further.

Cheers

Tom