Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

add negative sign in the data

Hello,

I have a bunch of data in the excel sheet and from talend I read those data and insert into the table. But when the amount is negative it still inserted as a positive number and that's why I am getting the wrong total of amount.


Example :: value = (100) is equivalent to -100.
Negative value comes in ().
I tried this but it's not working.

StringHandling.RIGHT(row27.line, 1).equals("(") ? 
"-" + StringHandling.EREPLACE(row27.line, "(", "") : row27.line 

@TRF Can you please help me out. 

Labels (2)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

Try this:

row27.line.contains("(") ? "-" + row27.line.substring(1, row27.line.length()-1) : row27.line

View solution in original post

3 Replies
TRF
Champion II
Champion II

Try this:

row27.line.contains("(") ? "-" + row27.line.substring(1, row27.line.length()-1) : row27.line
Anonymous
Not applicable
Author

@TRF I tried this and it's working fine.

Thanks for your help.

TRF
Champion II
Champion II

You're welcome