Hi All,
I am getting the below error while converting from string to decimal.
Case 1:
APT_CombinedOperatorController,1: A numeric string was expected, got " "; using Decimal, the default value.
String Data Type: Char[6]
Decimal Data Type: Decimal[11,2]
I am getting this warning only when there is blank in the Data, Also i am using setnull() if value is blank using below expr.
If (Len(Trim(Field_Name))=0) Then SetNull()
Else
StringToDecimal(Trim(Field_Name));
Also in another case i am using the same function there i am getting diffrent problem.
Case 2:
Source Data Type: Char[9] data looks like this +999.9999
Target data Type : Decimal[7,4]
Here also i am using same logic to set the blank values to null, But if blank is there i am getting it has 0 in the target.
Please do the needful.
Regards,
Madhu
Regards,
Madhu
StringToDecimal
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 222
- Joined: Tue Aug 30, 2005 2:07 am
- Location: pune
- Contact:
Convert function in transformer
Hi,
In case 1 : If u r input column field_name=blank means it contains null.So,u want to handle nulls By using If isnull(field_name) then 0.0 else Stringtodecimal(field_name)
In case 2 : If u r string contains +999.999,then first u want to remove + from string by using function convert("+",' ',field_name).Put this value in a stage variable FieldSVar.Then use function stringtodecimal(trim(FieldSVar)).
As per my knowldge it will solve u r problem.
Thanks&Regards
Nagesh
In case 1 : If u r input column field_name=blank means it contains null.So,u want to handle nulls By using If isnull(field_name) then 0.0 else Stringtodecimal(field_name)
In case 2 : If u r string contains +999.999,then first u want to remove + from string by using function convert("+",' ',field_name).Put this value in a stage variable FieldSVar.Then use function stringtodecimal(trim(FieldSVar)).
As per my knowldge it will solve u r problem.
Thanks&Regards
Nagesh
NageshSunkoji
If you know anything SHARE it.............
If you Don't know anything LEARN it...............
If you know anything SHARE it.............
If you Don't know anything LEARN it...............
Hi Nagesh,
Thanks for the Reply,
Case 1:The Problem is If data is blank means data is having spaces,beacuse the record is of fixed width, Also if blank/space is there iw ant to set that to NULL(Not to 0.0).
Case 2: Here from source i am splitting this field(9) into two fileds one is of 1 and another of 8, In the first field i am taking out the + sign, and in the next field data.
Here also i want to set if the value is blank to NULL.
Regards,
Madhu
Thanks for the Reply,
Case 1:The Problem is If data is blank means data is having spaces,beacuse the record is of fixed width, Also if blank/space is there iw ant to set that to NULL(Not to 0.0).
Case 2: Here from source i am splitting this field(9) into two fileds one is of 1 and another of 8, In the first field i am taking out the + sign, and in the next field data.
Here also i want to set if the value is blank to NULL.
Regards,
Madhu