0 Replies Latest reply on Jul 21, 2014 5:21 PM by Inderbir Singh

    Distance Parameters Null values

    Inderbir Singh

      Hello, I'm hoping someone can help me out there.  I'm trying to duplicate the "Distance+Parameter" sheet with my own data. https://www.tableausoftware.com/learn/tutorials/on-demand/advanced-mapping-techniques?signin=05773f72b457c95af97af0599ec5e387

       

      I've watched all videos, read all Kb articles regarding it and searched the internet.  Problem is when I try to use the following code from the "Distance Parameters" example.

       

      WINDOW_AVG(ATTR(if [CityStateAbbr]=[Central City] then [Latitude] end))  it gives me an error of "null values can't be used in if statements".  i scrubbed the data. no null values.  but it's still giving me the same error.

       

      so i tried to map cityStateAbbr but tableau only recognized 2 or 3 cities out of 1200 city state combos. and everything was "unrecognized" as a location.  examples of unrecognized included aberdeen, md.

       

      what these are is a list of airports with city, state combo. any ideas why tab can't recognize (plot) city, state pair?  i set their geocode as "City"...

       

      yes, lat, longs are available even the zips are available in one of my data sources but they're in a different database from my data source.  i cannot blend them because i need it to be one query. (think of customers/stores example)....

       

      thanks! any ideas/links would be greatly appreciated...also one suggestion with the Kbs should be an explanation of why we have to use the functions...

       

      update: 456pm pt

      I just tried with zip.  these zip codes are mapping but getting the same error as before about nulls...

       

      update: 5:15 PT

      ok so the issue it seems is not that the fields are null but rather [Latitude] is null.  let's see what i can do about that...

       

      "cannot use Null type in if expression" is the error...