Page 1 of 1

TI Process - Value Field Have Numbers and Strings

Posted: Tue Aug 13, 2013 5:29 pm
by tgaluskapatterson
TM1 10.1
Window XP
Excel 2007

Architect TI Process

I currently have a TI process in place to copy budget information from an active version that rules run on to a static version. I am using the ViewCreate function to generate the view to copy my data from. The issue I am running into is the variable 'Value' has both number and string values. Example: 80.27 and 79550-0000 Even if I use the CellPutN and CellPutS functions not all the data will come over because the TI process doesn't recognize 79550-0000 as a number and blanks out the 'Value'. Thus no information is being copied over for any 'Value' in the following format XXXXX-XXXX. If i right click on the view and click"Export as text data" then uncheck the "Skip Consolidated Values" and "Skip Zero/Blank Values" and save the view I can get the XXXXX-XXXX to copy to the static version. I was hoping their is a automated TI process for a create view function that would include zeros and blanks. I looked at the information center and developer guide and couldnt locate anything.

Create Initial Views
s_cubCX = 'CapEx_Summary';
s_subSrc = 'zSysSubBudgCpySrc';
s_subTrg = 'zSysSubBudgCpyTrg';
#Patt_CapEx_Summary
ViewCreate(s_cubCX, s_vwSrc);
ViewCreate(s_cubCX, s_vwTrg);
ViewSubsetAssign(s_cubCX, s_vwSrc, s_dVer, s_subSrc);
ViewSubsetAssign(s_cubCX, s_vwSrc, s_dPer, s_subSrc);
ViewSubsetAssign(s_cubCX, s_vwTrg, s_dVer, s_subTrg);
ViewSubsetAssign(s_cubCX, s_vwTrg, s_dPer, s_subTrg);

Code To Copy from Active Version To Static
if (Capex_Measures@='Account');
CellPutS(Value, 'CapEx_Summary',Cost_Center,Target_Version,CX_Projects,CX_Category,Currency_Type,Period,Capex_Measures);
else;
# the value is numeric so convert it
MyValue=StringToNumber(Value);
CellPutN(MyValue, 'CapEx_Summary',Cost_Center,Target_Version,CX_Projects,CX_Category,Currency_Type,Period,Capex_Measures);
ENDIF;

Re: TI Process - Value Field Have Numbers and Strings

Posted: Tue Aug 13, 2013 6:02 pm
by jim wood
Why not use the Dtype function? After all, the string values need to be within the last dimension. Just do a Dtype on the elements coming in from the view of that dimension. Then you just need to convert your if statement.

Re: TI Process - Value Field Have Numbers and Strings

Posted: Tue Aug 13, 2013 6:03 pm
by Duncan P
You need to use Value_Is_String to determine which it is and then NValue for numbers and SValue for strings.

Re: TI Process - Value Field Have Numbers and Strings

Posted: Tue Aug 13, 2013 6:11 pm
by jim wood
Or you can do that... :D