I have a MDX script that my goal is to be able to get the value of a date that could it a day, week, month, quarter or year and then use it on a hierarchy.
WITH
MEMBER measures.suma AS
Sum
(
[Date Local].[year-quarter-month-week-day].Children
,IIF
(
(
[Measures].[Agent Time Logged in hh:mm:ss]
-
[Measures].[Activity Time Break]
-
[Measures].[Activity Time Meeting]
-
[Measures].[Activity Time Training]
)
/
26400 / 86400
> 1
,1
,
(
[Measures].[Agent Time Logged in hh:mm:ss]
-
[Measures].[Activity Time Break]
-
[Measures].[Activity Time Meeting]
-
[Measures].[Activity Time Training]
)
/
26400 / 86400
)
)
SELECT
{
measures.suma
,[Measures].[MyKeys]
,[Measures].[Agent Time Logged in hh:mm:ss]
,[Measures].[Activity Time Break]
,[Measures].[Activity Time Meeting]
,[Measures].[Activity Time Training]
,[Measures].[Activity time Lunch]
} ON 0
,NON EMPTY
[Agent].[login fullname].[login fullname] ON 1
FROM [HP TRANSACTIONAL]
WHERE
[Date Local].[Month].&[2015-08 August];-- DOESNT WORK
--[Date Local].[year-quarter-month-week-day].[Week].&[2015 Week 35] --IT WORKS
As you can see in my MDX script
I want to sum all the activities of an agent and the client can choose any filter, per day, week, month, quarter or year.
Of course that thay can use my hierarchy "[Date Local].[Month].&[2015-08 August]" but my client is using EXCEL
to create the reports and they can use any attribute of the date dimension.
So my goal is to find a way to indicate to my mdx
script that if the client choose any attribute, should be able to get the current member and use the hierarchy to make the calculation.
Sum
function:[Date Local].[year-quarter-month-week-day].Children
– whytheq