mondrian - MDX sum from date dim to now -


i trying create calculated measure showing sum of measure on period of time current member of date dimension now.

the following code pretty bad hope give idea:

with member [measures].[numberfromdate] (     sum(         [date].currentmember:strtomember(format(now() , '[date]\.&[yyyy-mm-dd hh:mm:ss.0]' )     ), [measures].[number] ) 

in schema date dimension single level date of type date. mdx code give me error "cannot find mdx member '[date]'".

try strtoset instead:

with member [measures].[numberfromdate] (     sum(         strtoset(            '[date].currentmember:[date].[' & format(now() ,'yyyy-mm-dd hh:mm:ss.0') & ']'         )      ) , [measures].[number] ) 

here similar request on msdn: https://social.msdn.microsoft.com/forums/sqlserver/en-us/fdee9f45-8383-4446-b022-e9e877477aec/mdx-date-format

i'm bit unsure if format sring ok. string used in cube?

'yyyy-mm-dd hh:mm:ss.0'


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -