MDX oddity on }Cubes dimension
Posted: Thu Jul 14, 2022 1:33 am
I ran into this problem and a search did not turn up anything quite like it.
In short, I use copies of }Cubes and }Dimensions to actually work with (sys.Cubes and sys.Dimensions respectively), and wanted to create an MDX subset on sys.Cubes that filtered out cubes that were flagged <> YES for "DEMANDLOAD" for obvious reasons. However, it would not work!
Returns the complaint STRTOMEMBER: Error in value expression ""
So playing around I discovered this:
This is the case in 10.2 and PA. So TM1 does not like constructing a member from the }Cubes dimension if the source is not }Cubes? I do not recall having ever run into this, but just changed positions and no longer have access to my old MDX code base to search for anything like it. It is easy enough to work around, but think this is a bit clunky:
What am I missing or don't know about the }Cubes dimension? Not a big deal, but still odd to me.
In short, I use copies of }Cubes and }Dimensions to actually work with (sys.Cubes and sys.Dimensions respectively), and wanted to create an MDX subset on sys.Cubes that filtered out cubes that were flagged <> YES for "DEMANDLOAD" for obvious reasons. However, it would not work!
Code: Select all
FILTER( TM1SubsetAll( [sys.Cubes] ),
[}CubeProperties].(StrToMember("[}Cubes].[" + [sys.Cubes].currentmember.Name + "]"), [}CubeProperties].[DEMANDLOAD]) <> 'YES')
So playing around I discovered this:
Code: Select all
# This works in sys.Cubes:
GENERATE( TM1SubsetAll( [}Cubes] ), {StrToMember("[sys.Cubes].[" + [}Cubes].currentmember.Name + "]")})
# this does not in }Cubes:
GENERATE( TM1SubsetAll( [sys.Cubes] ), {StrToMember("[}Cubes].[" + [sys.Cubes].currentmember.Name + "]")})
Code: Select all
GENERATE( FILTER( TM1SubsetAll( [}Cubes] ), [}CubeProperties].([}CubeProperties].[DEMANDLOAD]) <> 'YES'),
FILTER( TM1SubsetAll( [sys.Cubes] ),
[sys.Cubes].currentmember.name = [}Cubes].currentmember.name)
)
What am I missing or don't know about the }Cubes dimension? Not a big deal, but still odd to me.