Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Negative Signs in String randomly disappears

Hi, I am facing an issue here.

 

This is my setup :

 

 

0683p000009M9Eo.pngTalend Setup0683p000009M9SB.png

You can notice that I use a routine to put the input that I want (A or B) in column "Echu" and "Non_Echu"

 

0683p000009M9Rd.png

 

All Inputs and Outputs are in Strings in the Routine as you can see, and in the tMap as well.

Everything works fine. the Function is doing almost what I want, BUT, in the output, some negative values (Strings that begin with "-" like : "-7.9" , "-9.7" etc.) that were in the Input are converted into Positive in the Ouput file. The "-" has disappeared.

 

 

Example : String that contained : "-888" in Input , once it comes out of the routine is "888.0".

I don't understand why, I've checked the routine but i don't see what is wrong with it.

Of course I checked the .csv input file and nothing is wrong with it either.

Only the Output comes SOMETIMES with positive values instead of negative.

 

 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I've found the error.

Just silly mistake of Inputs ^^. 

Thanks anyway for trying to help ! 

View solution in original post

7 Replies
manodwhb
Champion II
Champion II

As part of testing, can you just pass that filed with out using routine, is that native sign is removing or not?
Anonymous
Not applicable
Author

If I pass that field without using a routine, the issue disappears.

The String that contains -888 in Input is untouched in the Output : -888

manodwhb
Champion II
Champion II

Then your routine is causing the issue.
Anonymous
Not applicable
Author

Yes, But I don't know what is causing the issue in the routine. The code that I posted doesn't seem wrong either.

manodwhb
Champion II
Champion II

Try to use this and let me know is it removing.

row1.B!=null && row1.B.isEmpty()?row1.A:row1.B
Anonymous
Not applicable
Author

I have tried your method : row1.B!=null && row1.B.isEmpty()?row2.A:row1.B

 

It works ! It corrected the issue BUT, It doesn't do what I want.

What I want is : (row1.B!=null && row1.B.isEmpty())?"": (row2.A!=null && row2.A.isEmpty())? row1.B:row2.A

 

But the issue comes Back.

The String is converted from "-888" in the input into "888.0" in the Output.

I wonder why ...

Anonymous
Not applicable
Author

I've found the error.

Just silly mistake of Inputs ^^. 

Thanks anyway for trying to help !