Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
AlSalvC
Contributor II
Contributor II

Tmap assigns the same value to different variables

Hi everyone, I'm trying to assign different values to some variables but I get the same result in the 3 of them. The expression structure is the same but the input columns change. The expression is this one:

out2.Delta01 == null ? 

null

:

String.valueOf(Float.parseFloat(out2.Delta01)/Float.parseFloat(out2.DestinationSum01)) 

All the 3 variables get the same result which isnt even correct for any of them. It is a simple division, so I dont know where is the problem. The input rows are strings, thats why the conversion.

Yes, I have verified that the expression variables are set on the correct output columns.

The results I get are in the attached photo.

Thank you for your help.

7 Replies
Anonymous
Not applicable

Hello,

Elaborating your case with an example with input and expected output values will be helpful for us to understand your requirement and situation.

And please post your tMap Map Editor screenshot with If/else statement here.

Best regards

Sabrina

pablo125
Contributor II
Contributor II

I read your Question so I think that is like Verify the input data: Double-check that the input data in out2.Delta01 and out2.DestinationSum01 is as expected. Make sure they are valid numbers represented as strings. Check for null values: Ensure that there are no null values in out2.Delta01 or out2.DestinationSum01, as this can lead to unexpected results. You have already handled the case where out2.Delta01 is null in your expression, but it's important to confirm that both variables have non-null values for the division to work correctly. Debug the expression: Print or log the values of out2.Delta01 and out2.DestinationSum01 before performing the division to verify that they are indeed different for each variable. This will help identify if there's an issue with the assignment of values to the variables. Review the output columns: Ensure that the output columns for each variable are set correctly. It's possible that the values are being assigned to the same output column instead of separate ones, resulting in the same value for all variables. MyCCPay Login

AlSalvC
Contributor II
Contributor II
Author

Hi, this is my tmap configuration. I believe this is set up correctly.

AlSalvC
Contributor II
Contributor II
Author

this is the code

AlSalvC
Contributor II
Contributor II
Author

same for Delta02

AlSalvC
Contributor II
Contributor II
Author

I have already checked all of that. This are the values of the Sum, Delta and Rates.

Please find the code and tmap configuration that I used in the response to other comment. Thank you much for your help

AlSalvC
Contributor II
Contributor II
Author

I replied to my own comment instead of replying to yours. Please find my response in the thread.