After some research, I see that blending parameters is a popular topic but I haven't found a solution to this specific situation. Shortly said, I have 3 parameters from various datasets all stating the same year and I want to blend them (visually) into 1 so to eliminate this redundancy for my report's end-user.
In the "Available values" from "Parameter properties", all the values are taken from a dataset (hidden) and the "value field" is [Measures].[ParameterValue]
from their corresponding hidden dataset.
When I "show hidden datasets" and go into "text mode" of each of these hiden datasets are these are the 3 MEMBER [Measures].[ParameterValue] AS
:
[Time].[Financial Year].CURRENTMEMBER.UNIQUENAME
[Financial Period].[FP - Year].CURRENTMEMBER.UNIQUENAME
[Time exit].[Financial Year Exit].CURRENTMEMBER.UNIQUENAME
When you look at what value this gives, they have the following output (accordingly):
[Time].[Financial Year].&[2017]
[Financial Period].[FP - Year].[FP - Year].&[2017]
[Time exit].[Financial Year Exit].Financial Year Exit].&[2017]
A. So, in my opinion, since the "roots" of each [Year]
parameter value are different I need to create a dataset or a member within each of these hidden datasets that replaces this [2017]
. Is that "doable" and, if yes, any guidance on how?
B. If not, another outcome would be acceptable as well: the end user would need to generate mostly current year
and current year-1
. To tackle this I made a Template "Year" DS with the same content as in FP - Year and added the following members:
Member [Measures].[Last Year] as 'YEAR(NOW())-1'
Member [Measures].[Current Year] as 'YEAR(NOW())'
I inserted them into SELECT and previewed, it displays 2 new columns with 2017 and 2016. Then I went and changed in that PF-Year parameter's DS, value and label and I get an error. Any suggestions?
Any suggestions on this?
EDIT1: I have tackled B. and found a solution to it, I simply created the following 2 Default values for each parameter:
Current year: ="[Time].[Financial Year].&[" + CStr(Year(Now())) + "]"
Last year: ="[Time].[Financial Year].&[" + CStr(Year(Now())-1) + "]"
However, even though with this result I presume it will minimize the number of actions for the end-user, I would still prefer having 1 parameter showing instead of 3...
EDIT2 & partial solution I found another solution for A., it's not exactly what I wanted but it kind of gets the job done.
[CurrentYear]
and [LastYear]
CStr(Parameters!Year.Value(0))
and for CStr(Parameters!Year.Value(1))
accordingly. Example: ="[Year exit].[Financial Year exit].&[" + CStr(Parameters!Year.Value(0)) + "]"
. Current Year
and Last Year
.Even though this alleviates the issue, is there anyway to have a similar outcome but with the drop down menu displaying the actual years? i.e. it would be dynamic so in years to come, there would be 2018, 2019, etc. that would pop up? This way the end user would be able to compare not only current and past year but any 2 years?
Thanks to all!
EDIT3 Here is a screen shot of where I am at, at this point:
EDIT4
I have arrived to a fix: since I know that the end-users will only be comparing 2 years at a time (so 2 default values per parameter), I left hidden 2 parameters out of 3 and for the 2 hidden, I changed their default values.
So, I kept @[Financial Year]
as my main parameter and the others have the following default values:
@[FP - Year]:
="[Financial Period].[FP - Year].[FP - Year].&[" + CStr(Parameters!Financial Year(0)) + "]"
="[Financial Period].[FP - Year].[FP - Year].&[" + CStr(Parameters!Financial Year(1)) + "]"
@[Financial Year exit]:
="[Year exit].[Financial Year exit].&[" + CStr(Parameters!Financial Year(0)) + "]"
="[Year exit].[Financial Year exit].&[" + CStr(Parameters!Financial Year(1)) + "]"
And voilà the result:
I'd suggest two ways:
1: SSRS: add an invisible parameter (i.e. CurrentYear) and run in your MDX query the following:
StrToMember('[Time].[Financial Year].&[' +@CurrentYear + ']')
2: MDX: add a dynamic calculated members for each hierarchy:
member [Time].[Financial Year].[Current Year] as
StrToMember('[Time].[Financial Year].&[' + Format(Now(),'yyyy') + ']')
See my blog post for more details.