Hi there - newbie question here and desperately seeking some assistance with the report designer.
I have been tasked with migrating some reports from an old mondrian cube to a newer schema where certain fields have changed.
One report is giving me a large amount of hassle and its because i can't actually figure out how it works

The report is parametrised so first of all i deparameterised the report to get the plain query;
adding back one item at a time which pulls the report and narrowed the problem down to one item - all the other params work and parse correctly in the final query except for the 'sitearray' param
The report has 4 related parameters that get processed with 2 related queries .. the queries are;

Listofcustomers


WITH
MEMBER [Measures].[DebtorNo] AS
'[Customer].[Customer Name].CurrentMember.Properties("Customer Id")'
SELECT
NON EMPTY DISTINCT([Customer].Children) ON ROWS,
NON EMPTY {[Measures].[DebtorNo]} ON COLUMNS
From [WTN]

Parameter Name: Customer

type; drop down[Customer].[Customer Site Name]
query; list of customers
value; [Customer].[Customer Name]
display; [Customer].[Customer Name]
Post Processing Formula; =CONCATENATE(["[Customer].[Customer Name]"]; " - ";["[Measures].[DebtorNo]"])
And another query;
ListOfSites (which i suspect is the problem)
SELECT
NON EMPTY DESCENDANTS([Customer].[Customer Name].[${Customer}],1) ON ROWS,
NON EMPTY [Measures].[Quantity Actual] ON COLUMNS
From [WTN]
This feeds 3 more params;
Parameter Name: Site
Query; ListOfSites
Value; [Customer].[Customer Site Name]
Display Name; [Customer].[Customer Site Name]
SiteText;
Post Processing Formula;
="" & CSVTEXT([Site];false(); ", ") & ""

SiteArray;

Post Processing Formula;
="{[Customer].[Customer Site Name].[" & CSVTEXT([Site];false(); "],[Customer].[Customer Site Name].[") & "]}"

My front page successfully appears -- and i can select the customer and site name successfully -

Next page there is a pie graph with the following formula;

/*volumetric*/
WITH
SET [Sites] as {[Customer].[xxxx].[xxxxxxx]}

MEMBER [Measures].[Volume] as [Measures].[${VolumeMeasure}]
SELECT
NON EMPTY FILTER(Except([Waste Type].Children,
{[Waste Type].[Fixed Solutions],[Waste Type].[HIRE],[Waste Type].[Not Applic],[Waste Type].[STEAMCL],[Waste Type].[Steam Clean],[Waste Type].[Waste Analysis]}),[Measures].[Volume]>0.0) ON ROWS,
NON EMPTY [Measures].[Volume] ON COLUMNS
From [WTN]
WHERE
Crossjoin(
Filter( Descendants([Job Date.Month].[${Year}],1), [Job Date.Month].CurrentMember.Name='${Month}'),
Crossjoin(
[Sites],
Crossjoin(
{[Container].[Container Group Name].[Confidential],
[Container].[Container Group Name].[Containers],
[Container].[Container Group Name].[Customers Own],
[Container].[Container Group Name].[EuroBin],
[Container].[Container Group Name].[Food Waste],
[Container].[Container Group Name].[Rolonof ],
[Container].[Container Group Name].[Skips],
[Container].[Container Group Name].[Small Quantity],
[Container Group Name].[Customer Consumables]},
{[Movement].[C],
[Movement].[E],
[Movement].[S]}
)
)
)

This formula works successfully, but we have restricted the query to only one customer -- if i replace line 2 with:
SET [Sites] as ${SiteArray} - the entire report throws a hissy fit and refuses to run or preview the query - the error states;
org.pentaho.reporting.engine.classic.core.ReportDataFactoryException: Failed to create datasource:Mondrian Error:Failed to parse query '/*volumetric*/
WITH
SET [Sites] as <null>
MEMBER [Measures].[Volume] as [Measures].[<null>]
SELECT
NON EMPTY FILTER(Except([Waste Type].Children,
{[Waste Type].[Fixed Solutions],[Waste Type].[HIRE],[Waste Type].[Not Applic],[Waste Type].[STEAMCL],[Waste Type].[Steam Clean],[Waste Type].[Waste Analysis]}),[Measures].[Volume]>0.0) ON ROWS,
NON EMPTY [Measures].[Volume] ON COLUMNS
From [WTN]
WHERE
Crossjoin(
Filter( Descendants([Job Date.Month].[<null>],1), [Job Date.Month].CurrentMember.Name='<null>'),
Crossjoin(
[Sites],
Crossjoin(
{[Container].[Container Group Name].[Confidential],
[Container].[Container Group Name].[Containers],
[Container].[Container Group Name].[Customers Own],
[Container].[Container Group Name].[EuroBin],
[Container].[Container Group Name].[Food Waste],
[Container].[Container Group Name].[Rolonof ],
[Container].[Container Group Name].[Skips],
[Container].[Container Group Name].[Small Quantity],
[Container Group Name].[Customer Consumables]},
{[Movement].[C],
[Movement].[E],
[Movement].[S]}
)
)
)'
at org.pentaho.reporting.engine.classic.extensions.datasources.mondrian.AbstractMDXDataFactory.performQuery(AbstractMDXDataFactory.java:563)
at org.pentaho.reporting.engine.classic.extensions.datasources.mondrian.AbstractNamedMDXDataFactory.performQuery(AbstractNamedMDXDataFactory.java:145)
at org.pentaho.reporting.engine.classic.extensions.datasources.mondrian.BandedMDXDataFactory.queryData(BandedMDXDataFactory.java:54)
at org.pentaho.reporting.ui.datasources.mondrian.MondrianPreviewWorker.run(MondrianPreviewWorker.java:99)
at java.lang.Thread.run(Unknown Source)
ParentException:
mondrian.olap.MondrianException: Mondrian Error:Failed to parse query '/*volumetric*/
WITH
SET [Sites] as <null>
MEMBER [Measures].[Volume] as [Measures].[<null>]
SELECT
NON EMPTY FILTER(Except([Waste Type].Children,
{[Waste Type].[Fixed Solutions],[Waste Type].[HIRE],[Waste Type].[Not Applic],[Waste Type].[STEAMCL],[Waste Type].[Steam Clean],[Waste Type].[Waste Analysis]}),[Measures].[Volume]>0.0) ON ROWS,
NON EMPTY [Measures].[Volume] ON COLUMNS
From [WTN]
WHERE
Crossjoin(
Filter( Descendants([Job Date.Month].[<null>],1), [Job Date.Month].CurrentMember.Name='<null>'),
Crossjoin(
[Sites],
Crossjoin(
{[Container].[Container Group Name].[Confidential],
[Container].[Container Group Name].[Containers],
[Container].[Container Group Name].[Customers Own],
[Container].[Container Group Name].[EuroBin],
[Container].[Container Group Name].[Food Waste],
[Container].[Container Group Name].[Rolonof ],
[Container].[Container Group Name].[Skips],
[Container].[Container Group Name].[Small Quantity],
[Container Group Name].[Customer Consumables]},
{[Movement].[C],
[Movement].[E],
[Movement].[S]}
)
)
)'
at mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:972)
at mondrian.olap.ConnectionBase.parseStatement(ConnectionBase.java:100)
at mondrian.rolap.RolapConnection.parseStatement(RolapConnection.java:768)
at mondrian.olap.ConnectionBase.parseQuery(ConnectionBase.java:55)
at org.pentaho.reporting.engine.classic.extensions.datasources.mondrian.AbstractMDXDataFactory.performQuery(AbstractMDXDataFactory.java:420)
at org.pentaho.reporting.engine.classic.extensions.datasources.mondrian.AbstractNamedMDXDataFactory.performQuery(AbstractNamedMDXDataFactory.java:145)
at org.pentaho.reporting.engine.classic.extensions.datasources.mondrian.BandedMDXDataFactory.queryData(BandedMDXDataFactory.java:54)
at org.pentaho.reporting.ui.datasources.mondrian.MondrianPreviewWorker.run(MondrianPreviewWorker.java:99)
at java.lang.Thread.run(Unknown Source)
Caused by: mondrian.olap.MondrianException: Mondrian Error:Internal error: While parsing /*volumetric*/
WITH
SET [Sites] as <null>
MEMBER [Measures].[Volume] as [Measures].[<null>]
SELECT
NON EMPTY FILTER(Except([Waste Type].Children,
{[Waste Type].[Fixed Solutions],[Waste Type].[HIRE],[Waste Type].[Not Applic],[Waste Type].[STEAMCL],[Waste Type].[Steam Clean],[Waste Type].[Waste Analysis]}),[Measures].[Volume]>0.0) ON ROWS,
NON EMPTY [Measures].[Volume] ON COLUMNS
From [WTN]
WHERE
Crossjoin(
Filter( Descendants([Job Date.Month].[<null>],1), [Job Date.Month].CurrentMember.Name='<null>'),
Crossjoin(
[Sites],
Crossjoin(
{[Container].[Container Group Name].[Confidential],
[Container].[Container Group Name].[Containers],
[Container].[Container Group Name].[Customers Own],
[Container].[Container Group Name].[EuroBin],
[Container].[Container Group Name].[Food Waste],
[Container].[Container Group Name].[Rolonof ],
[Container].[Container Group Name].[Skips],
[Container].[Container Group Name].[Small Quantity],
[Container Group Name].[Customer Consumables]},
{[Movement].[C],
[Movement].[E],
[Movement].[S]}
)
)
)
at mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:972)
at mondrian.olap.Util.newInternal(Util.java:2421)
at mondrian.olap.Util.newError(Util.java:2437)
at mondrian.parser.JavaccParserValidatorImpl.convertException(JavaccParserValidatorImpl.java:110)
at mondrian.parser.JavaccParserValidatorImpl.parseInternal(JavaccParserValidatorImpl.java:59)
at mondrian.olap.ConnectionBase.parseStatement(ConnectionBase.java:96)
... 7 more
Caused by: mondrian.olap.MondrianException: Mondrian Error:Syntax error at line 3, column 16, token '<'
at mondrian.parser.JavaccParserValidatorImpl.convertException(JavaccParserValidatorImpl.java:99)
... 9 more



I hope this makes sense and apologise for the length of post but wanted to be detailed -- can anyone help out a noob in trouble here thanks a lot - JAMES