Hi all,
Just need some assistance in writing an MDX statement to pull in a cube value and pass it in to the function TM1SubsetToSet.
Here are some details:
-Dimension name is Location
-Lookup cube name is User Settings
-Measure trying to retrieve subset name from is Location_Subset_Name
I can get the function TM1 SubsetToSet function to work when I hard-code the location name:
TM1SubsetToSet ( [Location].[Location] , "New_Location" , "public")
And I tried wrapping this insdie the TM1SubsetToSet but I'm not having any luck:
StrToMember( "[Location].[" + CoalesceEmpty( [User Settings].(StrToMember( "[}Clients].[" + UserName + "]"), [User Settings].[Location_Subset_Name]), "<default>" ) + "]"),
My end goal is to have the name of the subset which changes by user be dynamically set in the Location dim with the TM1SubsetToSet function
Any advice would be much appreciated!
MDX for retrieving cube value in SubsetToSet
-
- Posts: 35
- Joined: Mon Aug 21, 2017 2:14 pm
- OLAP Product: TM1
- Version: 10.3
- Excel Version: 2016
MDX for retrieving cube value in SubsetToSet
- Attachments
-
- Screenshot_1.png (9.94 KiB) Viewed 1669 times
-
- Regular Participant
- Posts: 226
- Joined: Wed May 06, 2020 2:58 pm
- OLAP Product: Planning Analytics
- Version: 2.0.9
- Excel Version: 2016
Re: MDX for retrieving cube value in SubsetToSet
Try this:
Code: Select all
TM1SubsetToSet (
[Location].[Location]
, "" + [User Settings].(StrToMember( "[}Clients].[" + UserName + "]"), [User Settings].[Location_Subset_Name]) + ""
, "public")
-
- Posts: 35
- Joined: Mon Aug 21, 2017 2:14 pm
- OLAP Product: TM1
- Version: 10.3
- Excel Version: 2016
Re: MDX for retrieving cube value in SubsetToSet
That did the trick thank you!
-
- MVP
- Posts: 3222
- Joined: Mon Dec 29, 2008 6:26 pm
- OLAP Product: TM1, Jedox
- Version: PAL 2.1.5
- Excel Version: Microsoft 365
- Location: Brussels, Belgium
- Contact:
Re: MDX for retrieving cube value in SubsetToSet
I think that you can remove "" + and + "" unless Burnstripe is sure they are needed ?
Best regards,
Wim Gielis
IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Wim Gielis
IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
-
- Regular Participant
- Posts: 226
- Joined: Wed May 06, 2020 2:58 pm
- OLAP Product: Planning Analytics
- Version: 2.0.9
- Excel Version: 2016
Re: MDX for retrieving cube value in SubsetToSet
They were needed for passing the subset name within the tm1subsettosetWim Gielis wrote: ↑Wed Nov 20, 2024 1:39 am I think that you can remove "" + and + "" unless Burnstripe is sure they are needed ?
With the "" it returns as this and works
TM1SubsetToSet ([Location].[Location] , "my subset" , "public")
Without the "" it returns as this and fails
TM1SubsetToSet ([Location].[Location] , my subset , "public")
-
- MVP
- Posts: 3222
- Joined: Mon Dec 29, 2008 6:26 pm
- OLAP Product: TM1, Jedox
- Version: PAL 2.1.5
- Excel Version: Microsoft 365
- Location: Brussels, Belgium
- Contact:
Re: MDX for retrieving cube value in SubsetToSet
I see what is happening. I removed them, but then PAW put them there. So yes they are needed. Solvedburnstripe wrote: ↑Wed Nov 20, 2024 7:29 pmThey were needed for passing the subset name within the tm1subsettosetWim Gielis wrote: ↑Wed Nov 20, 2024 1:39 am I think that you can remove "" + and + "" unless Burnstripe is sure they are needed ?
With the "" it returns as this and works
TM1SubsetToSet ([Location].[Location] , "my subset" , "public")
Without the "" it returns as this and fails
TM1SubsetToSet ([Location].[Location] , my subset , "public")

Best regards,
Wim Gielis
IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Wim Gielis
IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly