6 Replies Latest reply: Apr 20, 2015 2:08 AM by Luca Degli Esposti RSS

    GeoMakePoint() leave blank field

      Hi all

      I'm building a new test application with map but I can't get GeoMakePoint() to work.

      I started with a large data set, but as I couldn't get it work, I tried the sample data from a previous post Qlik Sense Map

       

      The data samples contains Latitude and Longitude field and I try to use GeoMakePoint() while loading data

       

      LOAD

          CityID,

          AccentCity,

          Latitude,

          Longitude,

          GeoMakePoint(Latitude, Longitude) as Location,

          Population

      FROM [lib://Mappe/cities sample.csv]

      (txt, codepage is 1252, embedded labels, delimiter is ',', msq);

       

      But still get the Location field empty

      NULL.PNG.png

      As empty is the map with Location as Dimension

       

      Any idea?

      Thank you

       

      Luca

        • Re: GeoMakePoint() leave blank field
          Henric Cronström

          I looks as if some Longitudes and latitudes are strings (left-aligned) and not numbers (right -aligned).

           

          What happens if you insert

               IsNum(Longitude) as Debug,

          in the script?

           

          HIC

            • Re: GeoMakePoint() leave blank field

              Thank you Henric for your hint, I think you're right

              I tried the IsNum() function and only few apparently random fields are treated as numbers, so I tried to force fields to number and text changing the load script because I don't know if GeoMaxePoint() expects text or numbers:

               

              LOAD

                  CityID,

                  AccentCity,

                  Latitude,

                  Longitude,

                  Population,

               

              // Forcing Lat&Long to Text

                  GeoMakePoint(Text(Latitude), Text(Longitude)) as LocationText,

              // Forcing Lat&Long to Num

                  GeoMakePoint(Num#(Latitude), Num#(Longitude)) as LocationNum,

               

              // Checking if Num(Lat&Long) are numbers

                  IsNum(Latitude) as NumLatOriginal,

                  IsNum(Longitude) as NumLongOriginal,

              // Checking if Num(Lat&Long) are numbers

                  IsNum(Num#(Latitude)) as NumLat,

                  IsNum(Num#(Longitude)) as NumLong

                 

                FROM [lib://Mappe/cities sample.csv]

              (txt, codepage is 1252, embedded labels, delimiter is ',', msq);

               

              Nothing happens: fields are interpreted as text except the for aligned rigt with a -1 in NumLat or NumLong

              sense.gif

              and GeoMakePoint() still fails.

              What's wrong?