Posted: 9/7/2010
Hi All,
I have a cube that contains, among other things, a dimension listing all the procedure codes a patient has had on a given visit. I need to develop a report that uses this procedure code as selection criteria based on the evaluation of numerous values - procedure codes. That is, if a patient has one or more of these procedures, they should be included in the report.
It was suggested that I create a new Named Set in my cube to define the list of procedures in question. The idea is that the named set would contain the list of codes to be used in the report.
Questions:
1. What syntax should I use in my named set to create an if....then block where the named set selects records if one or more procedure codes are present in that record?
2. Is it better to write this MDX logic into my report instead of in the cube's named set? If so, is the syntax the same?
Thanks,
Sid
I think you can use the Strtoset()
if your parameter is populated using MDX then the selected values are (probably) going to be the string representation of the key of selected members. If you have multi-select enabled on the parameter, it will spit out a comma-separated string of selected values.
StrToSet(@Parametername, constrained)
It is appropriate to put it into the mdx of the report - because it's dynamic based on the user's choice. If the sets are hard-coded in their groupings then you could do it in the cube ... but then you'd want to provide the hard-coded set-names to the end-user for selection ....
Let me know if this helps.
Fahim.
Hi Fahim,
Thanks for your response. If I wanted to define the criteria in the MDX of my report, vs. a named set on the cube, would I use the StrToSet(@parametername,constrained) syntax? How would I create a parameter in MDX to be used in the selection criteria?