MDX USERNAME, differences in CAM and Mode 1?

Post Reply
User avatar
Steve Rowe
Site Admin
Posts: 2424
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

MDX USERNAME, differences in CAM and Mode 1?

Post by Steve Rowe »

Hi,
I've been banging my head against this one for a while now.

In my mode 1 dev environment I have the following MDX statement.

Code: Select all

 {StrToMember("[WARF ID].[Total " + [Front End Selection].([}Clients].["+USERNAME+"] ,[Selector].[WARF ID]) +"]").Children}
This behaves exactly as expected, returning the children of the element selected in my front end cube.

In the UAT environment which is set up under Mode 5 CAM the same MDX generates the error, STRTOMEMBER: Error in value expression: "" (There is a valid item selected in the front end cube)

If I substitute the value in the cube into the MDX just to check the general form of the MDX, then the MDX behaves as expected.

Code: Select all

 {StrToMember("[WARF ID].[Total LB000001L]").Children}
I'm assuming that there is a problem with the initial expression because the form of the CAM user name CAMID("Domain:blah") with the extra double quotes is causing an issue with the parsing of the username.

The odd thing is that this works correctly in the mode 5 environment.

Code: Select all

{StrToMember("[}Clients].["+USERNAME+"]") }
I've tried to substitute the above expression for the user name into my longer piece of MDX in place of the username reference in a few different ways to no effect.

Any ideas what's going on here?

It feels like a defect given that the simpler expression compiles but the more complex one does not.
Cheers,
Technical Director
www.infocat.co.uk
Adam
Posts: 106
Joined: Wed Apr 03, 2019 12:10 am
OLAP Product: IBM PA
Version: 2.0.9.x
Excel Version: Microsoft 365 x64

Re: MDX USERNAME, differences in CAM and Mode 1?

Post by Adam »

Hi Steve,

Instead of your ("first form"):

Code: Select all

 {StrToMember("[WARF ID].[Total " + [Front End Selection].([}Clients].["+USERNAME+"] ,[Selector].[WARF ID]) +"]").Children}
Does this work? ("second form"):

Code: Select all

 {StrToMember("[WARF ID].[Total " + [Front End Selection].(StrToMember( "[}Clients].[" + USERNAME + "]" ) ,[Selector].[WARF ID]) +"]").Children}
In the first form, I can recreate the same error as you in our Mode 5 setup but it works as expected in the second form.
I've started blogging about TM1, check it out: www.havaslabs.com

Take care,
Adam
User avatar
Steve Rowe
Site Admin
Posts: 2424
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: MDX USERNAME, differences in CAM and Mode 1?

Post by Steve Rowe »

Thanks alot Adam, Really appreciate it.

Working now, I'd swear blind that I'd tried that but probably not got exactly the right combination of brackets and quotes and pluses and brackets.

Really odd that the original form works in mode 1 but not in 5.

Cheers,
Technical Director
www.infocat.co.uk
tomok
MVP
Posts: 2832
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: MDX USERNAME, differences in CAM and Mode 1?

Post by tomok »

Steve Rowe wrote: Mon Oct 26, 2020 6:19 pm Thanks alot Adam, Really appreciate it.

Working now, I'd swear blind that I'd tried that but probably not got exactly the right combination of brackets and quotes and pluses and brackets.

Really odd that the original form works in mode 1 but not in 5.

Cheers,
I think it's because a user ID in CAM looks like this:

Code: Select all

CAMID("ActiveDirectyID")
while one in Mode 1 probably looks like this:

Code: Select all

UserID
Since the CAM ID is encapsulated inside apostrophes it is going to need different code to make your MDX work versus when it is Mode 1.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
User avatar
Steve Rowe
Site Admin
Posts: 2424
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: MDX USERNAME, differences in CAM and Mode 1?

Post by Steve Rowe »

Hi Tom,

I think the CAMID having the double quotes is the trigger for the problem but I've still not reached an understanding of why

Code: Select all

{StrToMember("[}Clients].["+USERNAME+"]") }
Is fine in both modes but

Code: Select all

 {StrToMember("[WARF ID].[Total " + [Front End Selection].([}Clients].["+USERNAME+"] ,[Selector].[WARF ID]) +"]").Children}
Only works mode 1.
My suspicion is that the statement shouldn't work in mode 1 either. The quote positioning seems off. Not really had time to really look hard as I am deep in the project right now.

Cheers,
Technical Director
www.infocat.co.uk
Post Reply