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;
TI Process - Value Field Have Numbers and Strings
-
- Posts: 31
- Joined: Thu Apr 25, 2013 1:36 pm
- OLAP Product: TM1
- Version: 10.1
- Excel Version: 2007
- jim wood
- Site Admin
- Posts: 3961
- Joined: Wed May 14, 2008 1:51 pm
- OLAP Product: TM1
- Version: PA 2.0.7
- Excel Version: Office 365
- Location: 37 East 18th Street New York
- Contact:
Re: TI Process - Value Field Have Numbers and Strings
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.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
-
- MVP
- Posts: 600
- Joined: Wed Aug 17, 2011 1:19 pm
- OLAP Product: TM1
- Version: 9.5.2 10.1 10.2
- Excel Version: 2003 2007
- Location: York, UK
Re: TI Process - Value Field Have Numbers and Strings
You need to use Value_Is_String to determine which it is and then NValue for numbers and SValue for strings.
- jim wood
- Site Admin
- Posts: 3961
- Joined: Wed May 14, 2008 1:51 pm
- OLAP Product: TM1
- Version: PA 2.0.7
- Excel Version: Office 365
- Location: 37 East 18th Street New York
- Contact:
Re: TI Process - Value Field Have Numbers and Strings
Or you can do that... 

Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7