spatial mdx date aggregation function is not working with date like 01/01/2014

88 views Asked by At

This is my mdx that is emitting error:

`with member [Measures].[incident_type] as '[incident].CurrentMember.Properties("incident_type")'
  member [Measures].[incident_desc] as '[incident].CurrentMember.Properties("incident_desc")'
  member [Measures].[incident_class] as '[incident].CurrentMember.Properties("incident_class")'
  member [Measures].[incident_image] as '[incident].CurrentMember.Properties("incident_image")'
  member [Measures].[modus_operandi] as '[incident].CurrentMember.Properties("modus_operandi")'
  member [Measures].[fir_status] as '[incident].CurrentMember.Properties("fir_status")'
  member [Measures].[fir_id] as '[incident].CurrentMember.Properties("fir_id")'
  member [Measures].[date_start_time] as '[incident].CurrentMember.Properties("date_start_time")'
  member [Measures].[the_geom] as '[incident].CurrentMember.Properties("the_geom")'
  member [Measures].[date_end_time] as '[incident].CurrentMember.Properties("date_end_time")'
   member [time].[newtime] as 'Aggregate({([time].[2012].[12].[19] : [time].[2012].[12].[31]),([time].[2013]),([time].[2014].[1].[1] : [time].[2014].[1].[8])})'
select {[Measures].[incident_type], [Measures].[incident_desc], [Measures].[incident_class], [Measures].[incident_image], [Measures].[modus_operandi], [Measures].[fir_status], [Measures].[fir_id],  [Measures].[the_geom], [Measures].[date_start_time] ,[Measures].[date_end_time] ,  [Measures].[incident_count]} ON COLUMNS,NON EMPTY Filter([incident].[incident_id].Members, ST_Contains([district].[district_id].[13221].Properties("the_geom"), [incident].CurrentMember.Properties("the_geom"))) ON ROWS  from [pin_mapping]  where ([time].[newtime])`

I am testing it on geomondrian workbench which is showing this error as below:

`Mondrian Error:Failed to parse query 'with member [Measures].[incident_type] as '[incident].CurrentMember.Properties("incident_type")' member [Measures].[incident_desc] as '[incident].CurrentMember.Properties("incident_desc")' member [Measures].[incident_class] as '[incident].CurrentMember.Properties("incident_class")' member [Measures].[incident_image] as '[incident].CurrentMember.Properties("incident_image")' member [Measures].[modus_operandi] as '[incident].CurrentMember.Properties("modus_operandi")' member [Measures].[fir_status] as '[incident].CurrentMember.Properties("fir_status")' member [Measures].[fir_id] as '[incident].CurrentMember.Properties("fir_id")' member [Measures].[date_start_time] as '[incident].CurrentMember.Properties("date_start_time")' member [Measures].[the_geom] as '[incident].CurrentMember.Properties("the_geom")' member [Measures].[date_end_time] as '[incident].CurrentMember.Properties("date_end_time")' member [time].[newtime] as 'Aggregate({([time].[2012].[12].[19] : [time].[2012].[12].[31]),([time].[2013]),([time].[2014].[1].[1] : [time].[2014].[1].[8])})' select {[Measures].[incident_type], [Measures].[incident_desc], [Measures].[incident_class], [Measures].[incident_image], [Measures].[modus_operandi], [Measures].[fir_status], [Measures].[fir_id], [Measures].[the_geom], [Measures].[date_start_time] ,[Measures].[date_end_time] , [Measures].[incident_count]} ON COLUMNS,NON EMPTY Filter([incident].[incident_id].Members, ST_Contains([district].[district_id].[13221].Properties("the_geom"), [incident].CurrentMember.Properties("the_geom"))) ON ROWS from [pin_mapping] where ([time].[newtime])'

`Mondrian Error:Error while parsing MDX statement 'with member [Measures].[incident_type] as '[incident].CurrentMember.Properties("incident_type")' member [Measures].[incident_desc] as '[incident].CurrentMember.Properties("incident_desc")' member [Measures].[incident_class] as '[incident].CurrentMember.Properties("incident_class")' member [Measures].[incident_image] as '[incident].CurrentMember.Properties("incident_image")' member [Measures].[modus_operandi] as '[incident].CurrentMember.Properties("modus_operandi")' member [Measures].[fir_status] as '[incident].CurrentMember.Properties("fir_status")' member [Measures].[fir_id] as '[incident].CurrentMember.Properties("fir_id")' member [Measures].[date_start_time] as '[incident].CurrentMember.Properties("date_start_time")' member [Measures].[the_geom] as '[incident].CurrentMember.Properties("the_geom")' member [Measures].[date_end_time] as '[incident].CurrentMember.Properties("date_end_time")' member [time].[newtime] as 'Aggregate({([time].[2012].[12].[19] : [time].[2012].[12].[31]),([time].[2013]),([time].[2014].[1].[1] : [time].[2014].[1].[8])})' select {[Measures].[incident_type], [Measures].[incident_desc], [Measures].[incident_class], [Measures].[incident_image], [Measures].[modus_operandi], [Measures].[fir_status], [Measures].[fir_id], [Measures].[the_geom], [Measures].[date_start_time] ,[Measures].[date_end_time] , [Measures].[incident_count]} ON COLUMNS,NON EMPTY Filter([incident].[incident_id].Members, ST_Contains([district].[district_id].[13221].Properties("the_geom"), [incident].CurrentMember.Properties("the_geom"))) ON ROWS from [pin_mapping] where ([time].[newtime])'

Mondrian Error:MDX object '[time].[2014].[1].[1]' not found in cube 'pin_mapping']`

What is the reason for this error?

1

There are 1 answers

2
whytheq On

Try changing [time].[2014].[1].[1] to a member that exists in the cube. Do you still get the same error?

If you do a range with : and either the left or right side member does not exist then the engine will evaluate this member as null