We are just moving to a SAP payroll system, and it produces negative values with the sign at the end, ie 2.365- instead of -2.365.
Does anyone have any brilliant idead for loading this via TI? I currently get a warning telling me that it cannot the value to a real number.
Thanks
Loading SAP Negative values via TI
-
- Site Admin
- Posts: 6664
- 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: Loading SAP Negative values via TI
Best option is to get the SAP DBA / Guru to fix the export format. Failing that there's always something like this. (The real variable is of course defined as String on the variables tab):digger1914 wrote:We are just moving to a SAP payroll system, and it produces negative values with the sign at the end, ie 2.365- instead of -2.365.
Does anyone have any brilliant idead for loading this via TI? I currently get a warning telling me that it cannot the value to a real number.
Code: Select all
# Let's pretend that...
s_StringVariable = '3.25-';
# Check whether the last character is a - sign...
If ( Subst ( s_StringVariable, Long ( s_StringVariable), 1 ) @= '-');
dbl_Multiplier = -1;
s_StringVariable = Subst ( s_StringVariable, 1, Long ( s_StringVariable) -1 );
Else;
dbl_Multiplier = 1;
EndIf;
dbl_NumericVariable = StringToNumber ( s_StringVariable ) * dbl_Multiplier;
"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: 6
- Joined: Thu Jun 05, 2008 3:34 am
Re: Loading SAP Negative values via TI
Thanks Alan for the prompt reply,
I had exactly the same thought a minute after posting. I went with
## Look for negative value entitlements with trailing sign
IF(SUBST(LSL_Hours_Ent,LONG(LSL_Hours_Ent),1) @= '-');
LSL_Hours_Ent_Calc = '-'|SUBST(LSL_Hours_Ent,1,LONG(LSL_Hours_Ent)-1);
LSL_Hours_Ent_Load = StringToNumber(LSL_Hours_Ent_Calc);
ELSE;
LSL_Hours_Ent_Load = StringToNumber(LSL_Hours_Ent);
ENDIF;
I had exactly the same thought a minute after posting. I went with
## Look for negative value entitlements with trailing sign
IF(SUBST(LSL_Hours_Ent,LONG(LSL_Hours_Ent),1) @= '-');
LSL_Hours_Ent_Calc = '-'|SUBST(LSL_Hours_Ent,1,LONG(LSL_Hours_Ent)-1);
LSL_Hours_Ent_Load = StringToNumber(LSL_Hours_Ent_Calc);
ELSE;
LSL_Hours_Ent_Load = StringToNumber(LSL_Hours_Ent);
ENDIF;