Page 1 of 3
Numeric values not copying from source to target elaments
Posted: Fri Sep 30, 2016 11:50 am
by aravind.cgns
Hello Guys,
I have created a TI Process using bedrock logic i am able to create views and it loads the string data from source elements to target elements but it is not loading the numeric data for the first run. If i update any data even in string cells for the next run of TI it is not even copying string data to target elements. I have both string and numeric data in my cube. I have attached my TI code. Please suggest me like where i am going wrong.
Re: Numeric values not copying from source to target elaments
Posted: Fri Sep 30, 2016 12:46 pm
by BariAbdul
I have both string and numeric data in my cube. I have attached my TI code. Please suggest me like where i am going wrong
This might help.
http://www.tm1forum.com/viewtopic.php?f=3&t=1109&p=6155 Thanks
Re: Numeric values not copying from source to target elaments
Posted: Fri Sep 30, 2016 12:50 pm
by qml
The process has a debug switch as one of its parameters. Use it and you're likely to get some information on what's going on. I doubt anyone will have the time and resolve to go through each line of that TI and try and figure out what it might be doing, especially since you haven't told us anything about your model, which means it's impossible to tell which conditions are being triggered among the dozens of IF statements.
On a separate note, I would like to draw your attention to the BedrockTM1.org copyright and licence notes:
BedrockTM1.org wrote:Anyone is free to copy, modify, use, compile, sell or distribute the original BedrockTM1.org code, documents and information (the information), either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means, with the exception that you may not reproduce or publish the information on any web site, online service or printed media without prior express permission.
Where the information is copied, modified, used, compiled, sold or distributed, credit to the original author or authors must be left intact in the code or document.
Re: Numeric values not copying from source to target elaments
Posted: Fri Sep 30, 2016 1:27 pm
by aravind.cgns
HI I am Just using that bedrock code as reference, i have a developed my own code. i am not publishing any original code of it. i have published an altered one which i wrote based on our requirement
Re: Numeric values not copying from source to target elaments
Posted: Fri Sep 30, 2016 1:33 pm
by aravind.cgns
Actually In my model i have to load data within a single dimension from one element to another element , i have a combination of two dimension's version and customer dimensions, in which data needs to be loaded from one dimension to other i.e customer to customer and version to version, i am passing the customer and version from control cubes as parameters. i have written a loop such that based on the selection of elements in dimensions from control cubes it has to write data in to target elements.
Re: Numeric values not copying from source to target elaments
Posted: Sat Oct 01, 2016 4:40 am
by BariAbdul
I have to load data from my source customer to multiple target customers, similarly from source version to multiple target versions.I have a maximum of 50 target customers and 10 target versions. I am loading the data with customer and version combination. I have built lookup cube with pick list in order to pass parameters dynamically into my TI process.
As per your previous post ,You are doing the same thing,I guess,It is just that you have mixed data in the form of string and numeric.Have you checked the link I have mentioned earlier ,Just incoporate that in your code.Thanks
Re: Numeric values not copying from source to target elaments
Posted: Mon Oct 03, 2016 7:06 am
by aravind.cgns
Hi Abdul ,
If( nDimensionCount = 2 );
If( CellIsUpdateable( pCube, v1, v2 ) = 1 );
DimType = DType( sDim2, v2 );
If( DimType @= 'S' );
CellPutS( v3, pCube, v1, v2 );
Else;
CellPutN( Numbr( v3 ), pCube, v1, v2 );
ENDIF;
I am using both CellPutS and CellPutN in my code still it failing to write numeric values into target cells.
Re: Numeric values not copying from source to target elaments
Posted: Mon Oct 03, 2016 8:35 am
by qml
aravind.cgns wrote:I am using both CellPutS and CellPutN in my code still it failing to write numeric values into target cells.
You really need to add a few AsciiOutput statements around your IFs to see what exactly is going on and which sections of your code get executed. No one here is able to execute every branch of your algorithm in their head under every possible condition.
The code snippet you've just posted does not exist in the process code you posted earlier. Settle on one version and then just debug it (using AsciiOutput) to see which of your assumptions are wrong - it could be that the element types are not what you think they are or that the source view is set up wrong or some entirely different problem.
Re: Numeric values not copying from source to target elaments
Posted: Mon Oct 03, 2016 2:30 pm
by Mark RMBC
I am posting this here because it may be related to aravind's problem.
I have an issue which is outlined in the attached document. This problem came to light when I tried to run a process to copy values from one cube to another. Everything worked OK, both string and numeric values copied over except for one numeric element which did not post any values. When investigating the problem I narrowed it down as explained in the attached document.
cheers, Mark
Re: Numeric values not copying from source to target elaments
Posted: Mon Oct 03, 2016 2:42 pm
by tomok
Mark RMBC wrote:I am posting this here because it may be related to aravind's problem.
I have an issue which is outlined in the attached document. This problem came to light when I tried to run a process to copy values from one cube to another. Everything worked OK, both string and numeric values copied over except for one numeric element which did not post any values. When investigating the problem I narrowed it down as explained in the attached document.
cheers, Mark
If you don't see values in a rule-calculated element when you suppress zeros it means the element has not been fed properly. Un-suppress and then right-click on one of the cells that contains the value that disappears when you suppress and then choose Check Feeders. If it says "Not Fed" then that's the problem.
Re: Numeric values not copying from source to target elaments
Posted: Mon Oct 03, 2016 3:05 pm
by Mark RMBC
You are spot on Tomok, these cells are not fed. I did actually suspect this myself (honest).
Now you may start ranting at me when I say this but because I don't actually need Grade Standard Hours to be fed (because it doesn't need to be consolidated) I ignored it when writing the feeders.
Is this bad practice and will not feeding it make my cube slower?
regards, Mark
Re: Numeric values not copying from source to target elaments
Posted: Mon Oct 03, 2016 3:20 pm
by tomok
Mark RMBC wrote:You are spot on Tomok, these cells are not fed. I did actually suspect this myself (honest).
Now you may start ranting at me when I say this but because I don't actually need Grade Standard Hours to be fed (because it doesn't need to be consolidated) I ignored it when writing the feeders.
Is this bad practice and will not feeding it make my cube slower?
regards, Mark
No, it's not bad practice to skip feeding an element, at least IMO. However, not doing so means the element will not consolidate AND it will disappear when you zero suppress.
Re: Numeric values not copying from source to target elaments
Posted: Mon Oct 03, 2016 3:22 pm
by qml
Mark RMBC wrote:Is this bad practice and will not feeding it make my cube slower?
Not at all. Underfeeding by itself cannot make a cube slower - if anything, it will be faster. It can however lead to incorrect results or zero suppression problems - sometimes these can be acceptable or worked around and sometimes they cannot.
Also, I would like to mention one additional circumstance where rule calculations might not work. If you do a DimensionElementInsertDirect without recompiling the dimension with DimensionUpdateDirect, a rule can fail to attach to the new element.
Re: Numeric values not copying from source to target elaments
Posted: Mon Oct 03, 2016 3:36 pm
by Mark RMBC
Thanks for the responses and the advice. I will leave unfed because as things stand I don't need to feed it and everything appears to be working correctly!
I will bold this in the design document

Re: Numeric values not copying from source to target elaments
Posted: Wed Oct 05, 2016 1:29 pm
by aravind.cgns
Hi Guys,
I was able to load both String and Numeric data now but i have a problem in creating Subset with multiple elements as i am using while loop it is taking the last element in the control cube . I need subset which has multiple elements being included . Please find the attached document and suggest me like where i am missing.
Re: Numeric values not copying from source to target elaments
Posted: Wed Oct 05, 2016 1:46 pm
by aravind.cgns
If( ViewExists( pCube, cTempViewFrom ) = 1 );
ViewDestroy( pCube, cTempViewFrom );
EndIf;
ViewCreate( pCube, cTempViewFrom );
If( SubsetExists( pDimension, cTempSubFrom ) = 1 );
SubsetDeleteAllElements( pDimension, cTempSubFrom );
Else;
SubsetCreate( pDimension, cTempSubFrom );
EndIf;
SubsetElementInsert( pDimension, cTempSubFrom, pSourceCustomer, i );
ViewSubsetAssign( pCube, cTempViewFrom, pDimension, cTempSubFrom );
Actually in the above code when i am trying to create the view it is throwing the below error ;
Position of elements exceeds the number of elements in subset + 1.
Re: Numeric values not copying from source to target elaments
Posted: Wed Oct 05, 2016 1:58 pm
by qml
aravind.cgns wrote:Actually in the above code when i am trying to create the view it is throwing the below error ;
Position of elements exceeds the number of elements in subset + 1.
Change the below line:
Code: Select all
SubsetElementInsert( pDimension, cTempSubFrom, pSourceCustomer, i );
to this:
Code: Select all
SubsetElementInsert( pDimension, cTempSubFrom, pSourceCustomer, 1 );
The error is due to the fact that you are only inserting those elements into the subset that meet certain criteria, so unless all of the elements in the dimension meet these criteria you will have fewer elements in the subset than in the dimension and so variable
i will be outside of the correct range of the subset's index.
It would also be very kind of you to share with us how you solved your first problem. It could help someone else, you know.
Re: Numeric values not copying from source to target elaments
Posted: Wed Oct 05, 2016 2:22 pm
by aravind.cgns
Abdul,
Intially i was using SubsetElementInsert( pDimension, cTempSubFrom, pSourceCustomer, 1 );
but i have multiple source customers and multiple target customers being selected in the control cube , so i need multiple elements to be added in my subset. when i use the above code it is creating the subset with the last element selected in the control which does not fit our requirement. suggest me like based on the loop it should create a subset which includes multiple elements included in my subset so that in my view i can see all the elements selected in my control cube.
Re: Numeric values not copying from source to target elaments
Posted: Wed Oct 05, 2016 2:31 pm
by qml
aravind.cgns wrote:Abdul,
I think you have me confused with someone else.
aravind.cgns wrote:i have multiple source customers and multiple target customers being selected in the control cube , so i need multiple elements to be added in my subset. when i use the above code it is creating the subset with the last element selected in the control which does not fit our requirement. suggest me like based on the loop it should create a subset which includes multiple elements included in my subset so that in my view i can see all the elements selected in my control cube.
You will need a WHILE loop that will cycle through something (a subset, a dimension etc.) that will allow you to execute SubsetElementInsert multiple times. The last parameter for this function is the location where you want to insert the element - it doesn't magically insert multiple elements for you, so I have no idea why you would expect that to happen.
Re: Numeric values not copying from source to target elaments
Posted: Wed Oct 05, 2016 2:46 pm
by aravind.cgns
Abdul,
I have while loop in my code u can see in my attached code, still i am facing the issue.