Fascinating (to me) method to modify parameters on the fly
I use MDX to query SSAS cubes and I've yet to find a decent MDX training program so I'm learning on the fly. I use a LOT of parameters in my reports; it is not uncommon to have 6 or 8 parameters per report. I was having a few problems that I recently was able to resolve. My first issue was dealing with calender year and fiscal year in a single report. I have a parameter that lets the user choose calender or fiscal. This is a bit more involved for me because I work for a company that has different divisions with different fiscal start dates - so I can't just define a fiscal calender. So I append the fiscal start date (month) to the division name when it is retrieved - division is also a parameter in all my reports. I use some custom code to take the start month and convert it into [Date Invoiced].[Month].&[2011]&[2]&[4] for starting date and also and end date - I then run the query with a BETWEEN clause. To make this work I was calling a subreport because that was the only way I could find that would allow me to apply the custom code to the parameter on the fly. What I subsequently discovered is I can just hit the three dot box next to the dataset on the data page which gives me access to all the parameters in the dataset (among other things). I can apply my code there without having to call a subroutine. The second problem I had I could not solve without this feature. As mentioned, all my reports have a division parameter to limit the scope of the report to any one division. Once the user selects a division they then can select a sales rep (on certain reports). But they only want to see sales reps that are members of the previously selected division. I have dimOrganization with a Division attribute and dimSalesReps which also has a Division attribute. My problem was applying [Organization].[Division].[selected division] to [Sales Rep].[Division].[selected division]. Using the same Parameters area I can do this: =iif(Parameters!Division.Label="All","[Sales Rep].[Division].[All]","[Sales Rep].[Division].&["+ Parameters!Division.Label + "]") I'm applying the Division previously selected in another dimension to my Sales Rep dimension. Now maybe everyone other than me already knew about this but to me it was quite a revelation. I eliminated dozens of subreports and was able to provide enhanced usability. It looks like I could do a whole lot more with filters and data options. Hopefully this will be of use to others. It was a life saver for me.
March 31st, 2011 11:11am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics