0
votes

I want to search date between two columns of same dimension. Columns name is start date and end date. I tried every thing, following query give me this error : Mondrian Error:Internal error: Cannot deduce type of call to function ':'

MDX query :

WITH 
  SET [~ROWS] AS 
    Hierarchize
    (
      {
        {[Location_Cluster.default].[All Location_Cluster.defaults]}
       ,{[Location_Cluster.default].[Location_Cluster].MEMBERS}
      }
    ) 
  MEMBER [Measures].[QTY Percent] AS 
      [Measures].[Total_Quantity]
    / 
      (
        [Measures].[Total_Quantity]
       ,[Location_Cluster.default].[All Location_Cluster.defaults]
      ) 
   ,format_string = '0.00%' 
  MEMBER [Measures].[Revenue Percent] AS 
      [Measures].[Total_Revenue]
    / 
      (
        [Measures].[Total_Revenue]
       ,[Location_Cluster.default].[All Location_Cluster.defaults]
      ) 
   ,format_string = '0.00%' 
  MEMBER [Measures].[Margin Percent] AS 
      [Measures].[Total_Margin]
    / 
      (
        [Measures].[Total_Margin]
       ,[Location_Cluster.default].[All Location_Cluster.defaults]
      ) 
   ,format_string = '0.00%' 
SELECT 
  NON EMPTY 
    {
      [Measures].[Sku_Count]
     ,[Measures].[Total_Quantity]
     ,[Measures].[QTY Percent]
     ,[Measures].[Total_Revenue]
     ,[Measures].[Revenue Percent]
     ,[Measures].[Total_Margin]
     ,[Measures].[Margin Percent]
    } ON COLUMNS
 ,NON EMPTY 
    [~ROWS] ON ROWS
FROM [APCS_SALES_CUBE]
WHERE 
  (
    {[Date].[Start_Date].&[2017-01-01] : NULL}
   ,{NULL : [Date].[End_Date].&[2017-03-01]}
   ,[Cluster.Cluster_Id].[2]
   ,[Taxonomy.default].[Taxonomy_ID].[3]
   ,[Company.Company_Name].[Compnay_Name].[1]
  );

I followed following links to resolve this issue. But don't know how to apply specify function in Mondrian MDX

https://ask.sqlservercentral.com/questions/95478/mdx-for-records-between-date-range-where-start-and.html#answer-142811

https://www.purplefrogsystems.com/blog/2013/04/mdx-between-start-date-and-end-date/#comment-1981

1

1 Answers

0
votes

Your query is not well formed. You need to make set out of the range you want to slice. Here is an example:

WITH SET [~ROWS] AS
 (${dateFromParameter} : ${dateToParameter}) 
MEMBER Measures.[number] as 
FORMAT([date].[godina].CurrentMember.PROPERTIES("datum"), "dd.mm.yyyy")
SET [ROOT] AS
FILTER([ORG].[org_id].Members, [ORG].[org_id].currentmember.parent.parent=[ORG].[org_id].currentmember.parent)        

SELECT
NON EMPTY {[Measures].[total], Measures.[number]} ON COLUMNS,
NON EMPTY [ROOT] * [~ROWS] ON ROWS
FROM [svcs]