I am building a TI process that looks for value at all the records at an intersection and increments another intersection by this value but I am not sure if I need to define a source and target view or if I can just do a calculation and if so how.
Source intersection
Cube - Sales
Period Dimension = All Periods
Location Dimension = Canada
Account Dimension = Account1
Product Dimension = Product1
Measure Dimension = Product1 Sales
So if for example a value returned for this is 60s, multiply those values by -1 (-60) and put them at the following intersection incrementing what is already there
Source intersection
Cube - Sales
Period Dimension = All Periods
Location Dimension = North America
Account Dimension = NA_Account1
Product Dimension = NA_Product1
Measure Dimension = NA_Product1 Sales
If this intersection has an existing value for the source intersection of 100 increment it by -60
I hope I am explaining this well enough
TI Process to increment value in a cell
-
- Posts: 26
- Joined: Mon Jul 19, 2021 2:15 pm
- OLAP Product: TM1
- Version: 2.0.0
- Excel Version: 365
- Alan Kirk
- Site Admin
- Posts: 6610
- 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: TI Process to increment value in a cell
As long as you can determine the target elements from the source elements, you don't need a target view... and more to the point the target view wouldn't help you anyway.M1ndbender wrote: ↑Thu Dec 14, 2023 7:31 pm I am building a TI process that looks for value at all the records at an intersection and increments another intersection by this value but I am not sure if I need to define a source and target view or if I can just do a calculation and if so how.
I presume that you mean TARGET intersection there.M1ndbender wrote: ↑Thu Dec 14, 2023 7:31 pm Source intersection
Cube - Sales
Period Dimension = All Periods
Location Dimension = Canada
Account Dimension = Account1
Product Dimension = Product1
Measure Dimension = Product1 Sales
So if for example a value returned for this is 60s, multiply those values by -1 (-60) and put them at the following intersection incrementing what is already there
Source intersection
I'm assuming that this is a consolidation of individual period elements. If so, you're stuffed at this point because you can't write numeric values to a consolidation. You would need to read from the individual periods and write to the individual periods.
There could well be a similar problem there. Unless you have North America as an N level element, rather than a consolidation of Canada + US + Mexico, you won't be able to write to it. (Though you COULD add an N element like "NA_North_America" to hold values that you don't want to break out. You could do something similar under the All Periods consolidation.)
You would also need some way to tell the TI that you want Canada data written into the North America N element; one way of doing that would be to create a text attribute for elements like Canada that the process could look up.
To my mind there is a more fundamental problem with your idea and it's this; how can you be ABSOLUTELY SURE that the process won't, intentionally or inadvertently, be run more than once? If it is, you'll end up with the values in the NA_x elements doubling, then tripling, then...M1ndbender wrote: ↑Thu Dec 14, 2023 7:31 pm Account Dimension = NA_Account1
Product Dimension = NA_Product1
Measure Dimension = NA_Product1 Sales
If this intersection has an existing value for the source intersection of 100 increment it by -60
From what you've described you'd probably be far better off doing this as a rule rather than a TI so that as values are added into Account1, Product1,
Product1 Sales the negative value automatically goes into NA_Account1, NA_Product1, NA_Product1 Sales. That way it is real time (nobody has to remember to run the process) and there is no risk of a double up.
"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.
-
- Posts: 15
- Joined: Thu Feb 20, 2014 8:42 am
- OLAP Product: TM1
- Version: PA 2.0.9
- Excel Version: 2016
- Location: Russia, Saint-Petersburg
Re: TI Process to increment value in a cell
Nothing is clear, but so interesting…
Maybe you are looking for this solution:
ValueSrc = CellGetN(CubeSrc, e1, e2 [,...en]);
ValueTrgCurrent = CellGetN(CubeTrg, e1, e2 [,...en]);
CellPutN(ValueSrc + ValueTrgCurrent, CubeTrg, e1, e2 [,...en]);
or
ValueSrc = CellGetN(CubeSrc, e1, e2 [,...en]);
CellIncrementN(ValueSrc, CubeTrg, e1, e2 [,...en]);
And before “copying” the data, clear the slice in the target.
Maybe you are looking for this solution:
ValueSrc = CellGetN(CubeSrc, e1, e2 [,...en]);
ValueTrgCurrent = CellGetN(CubeTrg, e1, e2 [,...en]);
CellPutN(ValueSrc + ValueTrgCurrent, CubeTrg, e1, e2 [,...en]);
or
ValueSrc = CellGetN(CubeSrc, e1, e2 [,...en]);
CellIncrementN(ValueSrc, CubeTrg, e1, e2 [,...en]);
And before “copying” the data, clear the slice in the target.