Well, you can't have a calculated field without having a field to base the calculation on.
You need 2 fields. Can't do it in one, as you need lat & long to be separate columns.
So, for latitude:
And something similar for Longitude. Then you set the geo role for each field to the corresponding value.
You'll end up with a point on a map. Is that what you're looking for?
in 2019.2 Makepoint was introduced - it can be nested in other calculation or used as a stand alone to create a single point
it would return this for your first point as an example
If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution. Thank you.
Thank for the reply. I'm curious about this MAKEPOINT calculation. How would this work with multiple points on a map? Let's say I have three regions (in my actual data set I have many, many more). How would this work? Getting an error message (below) when putting in more than one region into the calc field.
Thanks, Jim. I upgraded my version of Tableau and was able to get the MAKEPOINT function and render the points on the map.
Great - they are good additions - Distance makes it easier to calculate the "Crow fly" distance between 2 points
Glad to help out
I created these two calc fields, and changed one of the geo roles to Longitude and one to Latitude. However I'm not able to get the points to render on a map.
When I drag the newly created calc fields to rows or the level of detail shelf, "SUM" is showing before the name of the field.
Could you show me an example workbook and/or expand your answer on how to do this?
1 of 1 people found this helpful
Nuts, I can't implement this "MAKEPOINT" solution because my version of server is older than 2019.2. I'll have to find another solution.
1 of 1 people found this helpful
Hello again Marc,
Hope you're having a wonderful day. The battle isn't lost as yet and here is an interesting and
simple solution using an earlier version 10.5 (prior to 2019.2). I wish to Make a Point without having
to use the function Makepoint !
Please note that the current solution provided above works perfectly using the newer version (2019.2 &
2019.3). The following solution is for prior versions and the explanation is rated U (for all audiences).
Also the advantage of this method is that you have no restrictions on the number of points as long as
the dummy field has greater than or equal to the number of points you need to show on the map.
Here is the trick, using the simple superstore workbook (directly connecting to the excel workbook).
I looked for a dummy field you probably may not need to use as a filter on the dashboard and found
"Shipping Mode". Really, you can use any random field that is of little importance and create this calculated
field. Another option is doing a cross join to an excel file with the Latitude & Longitude data.
Luckily it had more than 3 values (actually 4) so with the following calculated fields you can easily arrive
at the solution and probably do a lot more like varying sizes based on numbers, use Squares or alternate
shapes etc. and add a little color.
Also remember to set the Longitude (Calc) & Latitude (Calc) fields to
Geographic Role as shown below:
The above screenshot is only for Longitude, but you will have to do it for
Latitude as well. Well with all this I regret that I have nothing else to say.
Question: Is there any catch to this method ?
Answer: Absolutely! This solution can fall apart if you place the "Ship Mode" field
into the filter shelf. But for the problem, I am assuming you will not need
it . Another option is to replicate and use this datasource for the map.
Hopefully you will have some other id field that you can use to create the above
calculated fields (it does not matter how many IDs you have as your problem only
requires 3 that will be allocated to the 3 Regions and the others will be Null).
The best part about Tableau is that it allows you to come up with completely new ways of
solving problems in addition to the existing ones. Here the importance is given to the idea
and how it is implemented rather than using it as a mere tool to achieve the result i.e. more
like the "Mind over Matter" approach.
I have attached the the twbx file below. I sincerely hope you find this alternate solution useful
in addition to being entertaining and it answers your problem. Also let me know if you have
any questions or would like any changes or further modifications. Best Wishes !