on 04-02-2015 4:35 PM
HI Team ,
I have a scenario where the input is coming as
<IndividualRevenueForCRE>2.00-</IndividualRevenueForCRE>
After doing the mapping of removing the negative sign from suffix and putting in profix using the code
if(a.indexOf("-") > 0)
{
return ("-" + a.substring(0,a.indexOf("-")) );
}
else
{return a;}
I am getting this output in the mapping as
<Value>-2.00</Value>
But when I am checking in MONI i am seeing a space between negative sign and value
<Value>- 2.00</Value>
And while coming in the file it is coming like
- 2.00 |
because of this it is failing in the target system , can anyone help in how to overcome this issue ?
Try adding a trim and observe the behavior
return ("-" + a.substring(0,a.indexOf("-")).trim());
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Abhishek,
You can archive this without UDF.
Use standard functions 'endsWith', 'replaceString' and then 'concat'.
Replace - with "" and then concat - at the beginning of string (If input ends with -).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.