dbTalk Databases Forums  

MDX Query for default dimension member

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss MDX Query for default dimension member in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ashish Tiwari
 
Posts: n/a

Default MDX Query for default dimension member - 10-29-2006 , 08:52 AM






Hi All,
We have a dimension structure as follows:
Dimesnion Name-
1. Calendar
-Year[level 1]
-Month [level 2]
2. Business
-Enterprise Id[level 1]
- All OG [level 2]
- OG [level 3]
-CO [level 4]
3. OG
-Enterprise Id[level 1]
- OPGRP [level 2]
- Client [level 3]
- Eng [level 4]
- Con [level 5]

Now I have to Select the month as the default member in the reporting tool
(DSP-Decision Support Panel) based on the "current month key" which is a
member property of business dimension's CO[level 4]. I get user information
in the form of domain\username and I have to remove domain name from this
string.

Can some help me finding out the mdx expression for this requirement.

Thanks in advance.

---------
Ashish Tiwari

Reply With Quote
  #2  
Old   
Ohjoo Kwon
 
Posts: n/a

Default Re: MDX Query for default dimension member - 10-29-2006 , 09:46 AM






Removing domain from the user information is simple. For example,

Mid( UserName, InStr(1, UserName, "\") + 1, 128 )

If the member name is comparable, next kind of expression can be considered.

StrToMember(StrToMember(Trim(Mid( UserName, InStr(1, UserName, "\") + 1,
128 ))).Properties("CurrentMonthKey"))

Ohjoo

"Ashish Tiwari" <AshishTiwari (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi All,
We have a dimension structure as follows:
Dimesnion Name-
1. Calendar
-Year[level 1]
-Month [level 2]
2. Business
-Enterprise Id[level 1]
- All OG [level 2]
- OG [level 3]
-CO [level 4]
3. OG
-Enterprise Id[level 1]
- OPGRP [level 2]
- Client [level 3]
- Eng [level 4]
- Con [level 5]

Now I have to Select the month as the default member in the reporting tool
(DSP-Decision Support Panel) based on the "current month key" which is a
member property of business dimension's CO[level 4]. I get user
information
in the form of domain\username and I have to remove domain name from this
string.

Can some help me finding out the mdx expression for this requirement.

Thanks in advance.

---------
Ashish Tiwari



Reply With Quote
  #3  
Old   
Ashish Tiwari
 
Posts: n/a

Default Re: MDX Query for default dimension member - 10-30-2006 , 03:00 AM



Thanks Ohjoo,
I was using a similar expression, i.e.
Filter({[Calendar].[Month
Nm].Members},[Calendar].CurrentMember.Properties("Month Key") =
[Business_Unilever].[LCase(Mid("_DOMAIN_USERNAME_",InStr("_DOMAIN_USERN AME_","\")+1))].[All Outsourcing].[AO/IO].[AO].Properties("Current Month Key")
But it doesn't work when I use it in our DSP tool, it doesn't remove the
domain from the enterprise id ("_DOMAIN_USERNAME_" gives the logged in users
enterprise id).

Any idea, suggesions....

---
Ashish Tiwari


"Ohjoo Kwon" wrote:

Quote:
Removing domain from the user information is simple. For example,

Mid( UserName, InStr(1, UserName, "\") + 1, 128 )

If the member name is comparable, next kind of expression can be considered.

StrToMember(StrToMember(Trim(Mid( UserName, InStr(1, UserName, "\") + 1,
128 ))).Properties("CurrentMonthKey"))

Ohjoo

"Ashish Tiwari" <AshishTiwari (AT) discussions (DOT) microsoft.com> wrote in message
news:7BCA3EFF-CBF7-4F10-8A1E-151EF6580184 (AT) microsoft (DOT) com...
Hi All,
We have a dimension structure as follows:
Dimesnion Name-
1. Calendar
-Year[level 1]
-Month [level 2]
2. Business
-Enterprise Id[level 1]
- All OG [level 2]
- OG [level 3]
-CO [level 4]
3. OG
-Enterprise Id[level 1]
- OPGRP [level 2]
- Client [level 3]
- Eng [level 4]
- Con [level 5]

Now I have to Select the month as the default member in the reporting tool
(DSP-Decision Support Panel) based on the "current month key" which is a
member property of business dimension's CO[level 4]. I get user
information
in the form of domain\username and I have to remove domain name from this
string.

Can some help me finding out the mdx expression for this requirement.

Thanks in advance.

---------
Ashish Tiwari




Reply With Quote
  #4  
Old   
Ohjoo Kwon
 
Posts: n/a

Default Re: MDX Query for default dimension member - 10-30-2006 , 06:57 AM



I don't know DSP. I guess "_DOMAIN_USERNAME_ functions as UserName MDX
function does. Right?

By the way, there is things strange in your expression. Next is not right
syntax.

[Business_Unilever].[LCase(Mid("_DOMAIN_USERNAME_",InStr("_DOMAIN_USERN AME_","\")+1))].[All
Outsourcing].[AO/IO].[AO].Properties("Current Month Key")

Full string must be completed before it is converted to Member. For example,

StrToMember("[Business_Unilever].[" +
LCase(Mid("_DOMAIN_USERNAME_",InStr("_DOMAIN_USERN AME_","\")+1)) + "].[All
Outsourcing].[AO/IO].[AO]").Properties(("Current Month Key")

I hope this could help you.

Ohjoo

"Ashish Tiwari" <AshishTiwari (AT) discussions (DOT) microsoft.com> wrote

Quote:
Thanks Ohjoo,
I was using a similar expression, i.e.
Filter({[Calendar].[Month
Nm].Members},[Calendar].CurrentMember.Properties("Month Key") =
[Business_Unilever].[LCase(Mid("_DOMAIN_USERNAME_",InStr("_DOMAIN_USERN AME_","\")+1))].[All
Outsourcing].[AO/IO].[AO].Properties("Current Month Key")
But it doesn't work when I use it in our DSP tool, it doesn't remove the
domain from the enterprise id ("_DOMAIN_USERNAME_" gives the logged in
users
enterprise id).

Any idea, suggesions....

---
Ashish Tiwari


"Ohjoo Kwon" wrote:

Removing domain from the user information is simple. For example,

Mid( UserName, InStr(1, UserName, "\") + 1, 128 )

If the member name is comparable, next kind of expression can be
considered.

StrToMember(StrToMember(Trim(Mid( UserName, InStr(1, UserName, "\") + 1,
128 ))).Properties("CurrentMonthKey"))

Ohjoo

"Ashish Tiwari" <AshishTiwari (AT) discussions (DOT) microsoft.com> wrote in message
news:7BCA3EFF-CBF7-4F10-8A1E-151EF6580184 (AT) microsoft (DOT) com...
Hi All,
We have a dimension structure as follows:
Dimesnion Name-
1. Calendar
-Year[level 1]
-Month [level 2]
2. Business
-Enterprise Id[level 1]
- All OG [level 2]
- OG [level 3]
-CO [level 4]
3. OG
-Enterprise Id[level 1]
- OPGRP [level 2]
- Client [level 3]
- Eng [level 4]
- Con [level 5]

Now I have to Select the month as the default member in the reporting
tool
(DSP-Decision Support Panel) based on the "current month key" which is
a
member property of business dimension's CO[level 4]. I get user
information
in the form of domain\username and I have to remove domain name from
this
string.

Can some help me finding out the mdx expression for this requirement.

Thanks in advance.

---------
Ashish Tiwari






Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.