TI Process to increment value in a cell

Post Reply
M1ndbender
Posts: 24
Joined: Mon Jul 19, 2021 2:15 pm
OLAP Product: TM1
Version: 2.0.0
Excel Version: 365

TI Process to increment value in a cell

Post by M1ndbender »

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
User avatar
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: TI Process to increment value in a cell

Post by Alan Kirk »

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.
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 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 presume that you mean TARGET intersection there.
M1ndbender wrote: Thu Dec 14, 2023 7:31 pm Cube - Sales
Period Dimension = All Periods
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.
M1ndbender wrote: Thu Dec 14, 2023 7:31 pm Location Dimension = North America
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.
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
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...

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.
Post Reply