Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

filtering using strtoset

Status
Not open for further replies.

scabral1979

Programmer
Feb 27, 2015
3
0
0
GB
Hi,

i have the following MDX query that uses parameters from an SSRS report to produce a result set:

WITH MEMBER PREM AS
StrToMember("[Measures].[" + @PremiumType+ " Premium]")
SELECT NON EMPTY
{PREM}
ON COLUMNS,
NONEMPTY
(Filter({ ([Prospect Client].[Account Number].[Account Number].ALLMEMBERS *
[Prospect Client].[Account Name].[Account Name].ALLMEMBERS *
[Prospect Client].[Division].[Division].ALLMEMBERS *
[Prospect Client].[Department].[Department].ALLMEMBERS *
[Prospect Client].[Section].[Section].ALLMEMBERS *
[Broker].[Account Direct Broker Code Previous].[Account Direct Broker Code Previous].ALLMEMBERS *
[Broker].[Account Direct Broker Code].[Account Direct Broker Code].ALLMEMBERS *
[Broker].[Account Broker Name Previous - Big 6].[Account Broker Name Previous - Big 6].ALLMEMBERS *
[Broker].[Account Broker Name - Big 6].[Account Broker Name - Big 6].ALLMEMBERS)}
,[Broker].[Account Broker Name - Big 6].CurrentMember.name <> [Broker].[Account Broker Name Previous - Big 6].CurrentMember.name
AND ([Broker].[Account Broker Name Previous - Big 6].Members = "Marsh" OR [Broker].[Account Broker Name - Big 6].CurrentMember.name = "Marsh")))
ON ROWS
FROM ( SELECT ( - { [Broker].[Account Broker Name Previous - Big 6].&[] } )
ON COLUMNS
FROM ( SELECT ( STRTOSET(@Operations, CONSTRAINED) )
ON COLUMNS
FROM ( SELECT( STRTOSET(@Division, CONSTRAINED) )
ON COLUMNS
FROM ( SELECT ( STRTOSET(@DateQuarter, CONSTRAINED) )
ON COLUMNS
FROM ( SELECT ( STRTOSET(@ProductLineGroup, CONSTRAINED) )
ON COLUMNS
FROM [Broker Premium])))))

the query gives me what I need, however, in the filter clause there is an OR statement that checks if the value of either the 'Account Broker Name Previous - Big 6' or the 'Account Broker Name - Big 6' = "Marsh". Instead of hard coding the value, i want to check a multi-valued parameter that will store the names pf the brokers. I need to somehow replace the OR statement to filter the result set based on what is coming in from the parameter to see if either field has the value(s) from the parameter.

so i basically need to replace the filter clause like this:

[Broker].[Account Broker Name Previous - Big 6].Members = STRTOSET(@Broker) OR [Broker].[Account Broker Name - Big 6].CurrentMember.name = STRTOSET(@Broker)

can this be done using MDX?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top