Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to convert from minus sign of BigDecimal value to plus sign in tMa

Hello,
Could anyone please teach about this issue.
There is minus value of Big decimal in Excel i wanna input to oracle DB.
How can i convert these values to plus sign in tMap?
I wanna convert only minus sign, plus sign value must be no change.
Does anyone know method to solve this issue?

Thanks!
Regards,
Labels (2)
22 Replies
Anonymous
Not applicable
Author

Hi
You can try tReplace.
Regards,
Pedro
Anonymous
Not applicable
Author

Hi Pedro,
I tried tReplace component but it couldn't replace minus sign.
I just wanna remove minus sign from only values which have minus sign.
Could this component replace even value of BigDecimal as string of minus sign such as '-'?
Following are expression I wrote.
Input column || Serch || Replace With
amount(bigdecimal) '-' ''
It shouldn't use single quart?
Thanks!
Regards,
Anonymous
Not applicable
Author

Hi
I'm afraid this is a bug.
Because when I check "simple mode", it doesn't replace minus with "".
Then I check "Advanced mode", it works.
Do you encounter the same issue?
Regards,
Pedro
Anonymous
Not applicable
Author

Hi Pedro,
I have encounter this issue first time.
It has no run when i use single quart or double quart for this component's settings.
Probably these quart are for some strings.
When I removed these quart,it is run but minus sign are not replaced.
How did you write expression for this component?
What should I do next?
Regards,
Anonymous
Not applicable
Author

Hi
Hope this image can help you.
Regards,
Pedro
Anonymous
Not applicable
Author

Hi Pedro,
I tried using expression you uploaded.
But it didn't run and displayed an error like following.
<Error Message>
Method of StringUtils which is repalceALL(string,string,string) can't use argument (BigDecimal,string,string)
Sorry,If you can't read.
I translate from Japanese to English this error message.
Did you use column of BigDecimal?
Regards,
Anonymous
Not applicable
Author

Hi
Got it.
Change Data type into String.
Then you will get correct result.
Regards,
Pedro
Anonymous
Not applicable
Author

Hi Pedro,
I have to replace with type of BigDecimal.
Because, it need to be same with type of DB column I wanna load.
How can i solve this issue?
Regards,
Anonymous
Not applicable
Author

Hi
You can make a conversion here.
Convert Decimal into String. Then use tRaplace.
In the end, change it back to Decimal.
Decimal to String: .toString() method.
String to Decimal: new BigDecimal(String string);
Regards,
Pedro