开发者

SSRS Parse UniqueName of a member to display it as date in Using MDX

开发者 https://www.devze.com 2023-04-12 10:52 出处:网络
here is my probl开发者_运维问答em [Time].[Month Hierarchy].[Day].&[2006]&[2]&[26] how to parse the UniqueName above to display like this --> 2006/2/26 using mdx or expression in ssrs

here is my probl开发者_运维问答em

[Time].[Month Hierarchy].[Day].&[2006]&[2]&[26]

how to parse the UniqueName above to display like this --> 2006/2/26 using mdx or expression in ssrs

thank you very much


You can use the expression below. Change the field name to match your own.

= Replace(Replace(Replace(Mid(Fields!Day.value,33,16),']',''),'[',''),'&','/')


If you know than every level contains the appropiate member_key you could use the VB date functions:

With Member Measures.Date As DATESERIAL( 
Ancestor([Time].[Month Hierarchy].CurrentMember, [Time].[Month Hierarchy].[YEAR_LEVEL]).MEMBER_KEY, 
Ancestor([Time].[Month Hierarchy].CurrentMember, [Time].[Month Hierarchy].[MONTH_LEVEL]).MEMBER_KEY,
[Time].[Month Hierarchy].CurrentMember.MEMBER_KEY)
Select 
{Measures.Date} On Columns,
{[Time].[Month Hierarchy].[Day].&[2006]&[2]&[26]} On Rows 
From [YOUR_CUBE]
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号