Author: Kepion Product Team
Introduction
You can use MDX to determine the current day dynamically with VB functions. MDX supports VB functions and you can use it directly in MDXScript (when defined in Models/Cubes) or within your variables when used as part of your Form Definition.
Example
By using a combination of VB functions, you can dynamically resolve a member in MDX:
select
{
StrToMember("[Time].[Fiscal Calendar].&["
+ CStr(Year(Now())) -- 2015
+ Right("0" + CStr(Month(Now())), 2) -- 08
+ "00]")
}
on 0
from Finance
Run the examples below to see the results:
-- show the value of Year(Now())
with
member time_days.memberid.year as 'Year(Now())'
select { time_days.memberid.year } on 0 from $time_days
-- show the value of Month(Now())
with
member time_days.memberid.month as 'Month(Now())'
select { time_days.memberid.month } on 0 from $time_days
-- show the value of Day(Now())
with
member time_days.memberid.day as 'Day(Now())'
select { time_days.memberid.day } on 0 from $time_days
Comments
0 comments
Please sign in to leave a comment.