AnsweredAssumed Answered

Date parameters in mdx query

Question asked by Veronika Florova on Jan 23, 2019

Hello, I have to make a cde dashboard with some selectors and two date range components which should reflect on a table component. However I have problems with positioning the date parameters in the source query of the table.

WITH

SET [~ROWS_Objects_Objects.object] AS

{[Objects.object].[object_name].Members}

SET [~ROWS_Companies_Companies.Company_name] AS

{[Companies].[Company_name].Members}

SET [~ROWS_Date_Date.Date_iso] AS

{[Date.Date_iso].[day_date].Members}

SET [~ROWS_Date_last_Date_last.Date_last_iso] AS

{[Date_last.Date_last_iso].[day_date].Members}

SELECT

NON EMPTY {[Measures].[sum_qtyprice], [Measures].[sum_qty]} ON COLUMNS,

NON EMPTY NonEmptyCrossJoin([~ROWS_Objects_Objects.object], NonEmptyCrossJoin(${typeParameter}, NonEmptyCrossJoin([~ROWS_Date_Date.Date_iso], NonEmptyCrossJoin([~ROWS_Date_last_Date_last.Date_last_iso], [~ROWS_Companies_Companies.Company_name])))) ON ROWS

FROM [Store2]
I am pretty sure the four date parameters should be in where clause, however it looks like I don't know how to write it properly.
I set this function

function(start, end) {

var formatted = Utils.dateFormat(start, 'yyyy-MM-dd') +

" " + this.inputSeparator + " " +

Utils.dateFormat(end, 'yyyy-MM-dd');

this.placeholder('input').val(formatted);

}
to PreExecution property of the range component.
I would appreciate any help

Outcomes