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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Cherichoc-
Creator
Creator

calculate difference between two columns using tMap

One extraction is from Json and the other from an existing table. I want to great a variable in tmap that will be added In the output
JSON                                          ExistingTable                     OutputVar
Latitude                                        latitude                                latitude
-24.50                                          -24.10                                   0.40

 

Then if the variable difference is greater than 0.50 use the JSON data. I can use the tFilter row for that

Labels (5)
7 Replies
Anonymous
Not applicable

The problem you have here is linking the two datasets. Do you have a key that can join them?

Cherichoc-
Creator
Creator
Author

They are joined by deviceID with both longitude and latitude

tExtractJasonField>>>>tMap<<<<<<tDBinput

                                          |

                                          | 

I need to create variable that will calculate the [existing coordinates(from tdbinput) minus new coordinates(from jSon)]

 

Anonymous
Not applicable

Then join the data using the tMap and subtract one from the other.

Cherichoc-
Creator
Creator
Author

row1.latitude - row2.latitude is not working

Anonymous
Not applicable

What is the data type of your GPS columns? I suspect that they might be Strings. They need to be Doubles

Cherichoc-
Creator
Creator
Author

datatype is double

Anonymous
Not applicable

Subtraction should work then. Can you show the tMap you are trying this in? I'll need to see the whole screen so that I can see data types and the expressions that are used