Hi, anyone knows how to change weight in TI for existing elements?
I tried to use DIMENSIONELEMENTCOMPONENTADDDIRECT/DIMENSIONELEMENTCOMPONENTADD functions. They don't work.
Change weight in TI
- Alan Kirk
- Site Admin
- Posts: 6606
- Joined: Sun May 11, 2008 2:30 am
- OLAP Product: TM1
- Version: PA2.0.9.18 Classic NO PAW!
- Excel Version: 2013 and Office 365
- Location: Sydney, Australia
- Contact:
Re: Change weight in TI
That doesn't surprise me; I don't think that any of the "add" functions do anything if the element already exists in the dimension or consolidation, as the case may be.macsir wrote:Hi, anyone knows how to change weight in TI for existing elements?
I tried to use DIMENSIONELEMENTCOMPONENTADDDIRECT/DIMENSIONELEMENTCOMPONENTADD functions. They don't work.
I haven't tested it but I think the way you'd need to do that is with DimensionElementComponentDelete to get rid of the existing child then DimensionElementComponentAdd to add it back with the new weighting, all in either Prolog or Metadata, obviously.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
- macsir
- MVP
- Posts: 782
- Joined: Wed May 30, 2012 6:50 am
- OLAP Product: TM1
- Version: PAL 2.0.9
- Excel Version: Office 365
- Contact:
Re: Change weight in TI
Thanks, Alan. That works but since I have dimension sheet attach to it, it won't get refreshed if I updated it in TI. Any idea to sync them?Alan Kirk wrote:That doesn't surprise me; I don't think that any of the "add" functions do anything if the element already exists in the dimension or consolidation, as the case may be.macsir wrote:Hi, anyone knows how to change weight in TI for existing elements?
I tried to use DIMENSIONELEMENTCOMPONENTADDDIRECT/DIMENSIONELEMENTCOMPONENTADD functions. They don't work.
I haven't tested it but I think the way you'd need to do that is with DimensionElementComponentDelete to get rid of the existing child then DimensionElementComponentAdd to add it back with the new weighting, all in either Prolog or Metadata, obviously.
- Alan Kirk
- Site Admin
- Posts: 6606
- Joined: Sun May 11, 2008 2:30 am
- OLAP Product: TM1
- Version: PA2.0.9.18 Classic NO PAW!
- Excel Version: 2013 and Office 365
- Location: Sydney, Australia
- Contact:
Re: Change weight in TI
Ah. You didn't mention that you had an .xdi. That changes things radically.macsir wrote:Thanks, Alan. That works but since I have dimension sheet attach to it, it won't get refreshed if I updated it in TI. Any idea to sync them?Alan Kirk wrote:That doesn't surprise me; I don't think that any of the "add" functions do anything if the element already exists in the dimension or consolidation, as the case may be.macsir wrote:Hi, anyone knows how to change weight in TI for existing elements?
I tried to use DIMENSIONELEMENTCOMPONENTADDDIRECT/DIMENSIONELEMENTCOMPONENTADD functions. They don't work.
I haven't tested it but I think the way you'd need to do that is with DimensionElementComponentDelete to get rid of the existing child then DimensionElementComponentAdd to add it back with the new weighting, all in either Prolog or Metadata, obviously.
Nobody should ever modify a dimension which is .xdi-based using a non-xdi method. Dimension Editor and TI can be mixed, but .xdi should never be used with any other method. (Admittedly Dim Editor will rebuild an .xdi for you (if you have all of your settings correct) but you lose many of the advantages of .xdis that way.)
The good news is that if you're using an .xdi changing the weighting is a doddle; you just put the new weighting in column C and recompile the dimension.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
- macsir
- MVP
- Posts: 782
- Joined: Wed May 30, 2012 6:50 am
- OLAP Product: TM1
- Version: PAL 2.0.9
- Excel Version: Office 365
- Contact:
Re: Change weight in TI
ta. Alan.
- gtonkin
- MVP
- Posts: 1198
- Joined: Thu May 06, 2010 3:03 pm
- OLAP Product: TM1
- Version: Latest and greatest
- Excel Version: Office 365 64-bit
- Location: JHB, South Africa
- Contact:
Re: Change weight in TI
Depending on how you are applying the "direct" commands, you may need to use amacsir wrote:I tried to use DIMENSIONELEMENTCOMPONENTADDDIRECT/DIMENSIONELEMENTCOMPONENTADD functions. They don't work.
Code: Select all
DimensionUpdateDirect(DimName);
- macsir
- MVP
- Posts: 782
- Joined: Wed May 30, 2012 6:50 am
- OLAP Product: TM1
- Version: PAL 2.0.9
- Excel Version: Office 365
- Contact:
Re: Change weight in TI
Hi, gtonkingtonkin wrote: Depending on how you are applying the "direct" commands, you may need to use ato finalise.Code: Select all
DimensionUpdateDirect(DimName);
Thanks for the advice, I checked this function as well. It doesn't work. But the function name sounds like it should do the trick. It is more like garbage collection in Java to clean up the footprint in Ram from other direct functions if I am not wrong.
-
- MVP
- Posts: 170
- Joined: Fri Dec 10, 2010 4:07 pm
- OLAP Product: TM1
- Version: [2.x ...] 11.x / PAL 2.0.9
- Excel Version: Excel 2013-2016
- Location: Germany
Re: Change weight in TI
You could simply update col C in .xdi, but if you really need to have your change done using TI, then you can go ahead with Alan's approach and finally recreate the .xdi from .dim again.
After the TI has made all changes, just use the Dim editor in Perspectives and add a dummy element like 123 to "yourdim", while you have your local server option in Perspectives pointed to the folder, where a file "yourdim.xdi" resides. This can be the old yourdim.xdi or any file renamed (e.g. blank file created by Notepad) for initial .xdi creation for example.
After the TI has made all changes, just use the Dim editor in Perspectives and add a dummy element like 123 to "yourdim", while you have your local server option in Perspectives pointed to the folder, where a file "yourdim.xdi" resides. This can be the old yourdim.xdi or any file renamed (e.g. blank file created by Notepad) for initial .xdi creation for example.