Hi,
My question is "How can I pass a date filter parameters to MDX query?"
Actually, I'm trying to create a report using CDE Dashboard in Pentaho bi server 6 (CE). I created a date filter using Date range input component to choose @fromDate and @endDate values and i used mdx query to get datas from my datasource. For the Date range input parameter, i created two Date Parameters "param_fromDate" and "param_toDate", and I chose these params as Listeners and parameters in the advanced Properties of the date range parameter.
I created a postChange function that splits these parameters (in YYYY-MM-DD format) to get its parts (year, month and day), uses these parts to create two string parameters that contains the MDX statement for the date condition like: param1 = "[Time].["+from_year+"].["+from_month+"].["+from_day+"]" and param2 = "[Time].["+to_year+"].["+to_month+"].["+to_day+"]".
I created two parameters (from_date, to_date) fro the mdx query and i set its value with the strings created at the previous step (param1, param2), so my query looks like this:
"WITH
SET [~COLUMNS] AS
{[Agent].[Agent Login].Members}
SET [~ROWS] AS
{[Campaign].[Campaign Name].Members}
SELECT
NON EMPTY CrossJoin([~COLUMNS], {[Measures].[CPlus]}) ON COLUMNS,
NON EMPTY [~ROWS] ON ROWS
FROM [G3]
where (${from_date}:${to_date})"
But, when i try to preview my dashboard nothing is shown and it returns an error in the log server: "Mondrian Error: MDX object 'param_from_converted' noot found in cube". what should i do??
My question is "How can I pass a date filter parameters to MDX query?"
Actually, I'm trying to create a report using CDE Dashboard in Pentaho bi server 6 (CE). I created a date filter using Date range input component to choose @fromDate and @endDate values and i used mdx query to get datas from my datasource. For the Date range input parameter, i created two Date Parameters "param_fromDate" and "param_toDate", and I chose these params as Listeners and parameters in the advanced Properties of the date range parameter.
I created a postChange function that splits these parameters (in YYYY-MM-DD format) to get its parts (year, month and day), uses these parts to create two string parameters that contains the MDX statement for the date condition like: param1 = "[Time].["+from_year+"].["+from_month+"].["+from_day+"]" and param2 = "[Time].["+to_year+"].["+to_month+"].["+to_day+"]".
I created two parameters (from_date, to_date) fro the mdx query and i set its value with the strings created at the previous step (param1, param2), so my query looks like this:
"WITH
SET [~COLUMNS] AS
{[Agent].[Agent Login].Members}
SET [~ROWS] AS
{[Campaign].[Campaign Name].Members}
SELECT
NON EMPTY CrossJoin([~COLUMNS], {[Measures].[CPlus]}) ON COLUMNS,
NON EMPTY [~ROWS] ON ROWS
FROM [G3]
where (${from_date}:${to_date})"
But, when i try to preview my dashboard nothing is shown and it returns an error in the log server: "Mondrian Error: MDX object 'param_from_converted' noot found in cube". what should i do??