On the same (lat,long) on a Tableau-Desktop map, I want the size of a dot to be proportional to the number of records at that location. I tried count/sum(Number of Records) built-in tableau measure, I created a SeqId and tried count(SeqId) for Size, neither worked. Here is a sample of my data, as you can see:
(44.92810490,-74.89186500) has one Record
(44.69948730,-73.45291240) has five Records
(44.72143010,-73.72375280) has 10 records
I would like the point to be proportional to the number of records at that location. Help is Much appreciated
Musa
Seq Id,Census,Gender,Lat,Long
1,1860,F,44.92810490,-74.89186500
2,1870,M,44.69948730,-73.45291240
3,1870,F,44.69948730,-73.45291240
4,1870,M,44.69948730,-73.45291240
5,1870,F,44.69948730,-73.45291240
6,1870,F,44.69948730,-73.45291240
7,1870,M,44.72143010,-73.72375280
8,1870,M,44.72143010,-73.72375280
9,1870,M,44.72143010,-73.72375280
10,1870,M,44.72143010,-73.72375280
11,1870,M,44.72143010,-73.72375280
12,1870,M,44.72143010,-73.72375280
13,1870,M,44.72143010,-73.72375280
14,1870,M,44.72143010,-73.72375280
15,1870,M,44.72143010,-73.72375280
16,1870,M,44.72143010,-73.72375280
Can you try this?
Create a calculated field "Geo" with this definition
IFNULL(STR([Lat]),"")+ ","+IFNULL(STR([Long],"")
Move this field in "size" mark using Count([Geo])
Hope this should give you the desired result.
Put Latitude on the Rows shelf, and then right click on the pill and convert it to a dimension. Make sure it stays continuous.
Likewise, put Longitude on the Columns shelf and convert it to a dimension
Put SUM(Number of Records) on the size shelf
Important, Don't have any other dimensions on any shelves, leave SeqId off
This approach will make one mark for each unique latitude/longitude pair and size that mark according to how many times that pair appears in the data set.
A problem you will probably notice is that two latitudes that differ only in the final decimal place are treated as distinct latitudes. That may not make the most useful visualization. You can bin nearby latitudes together by making a calculated field to round values to the degree you wish. If you do that, be sure to make your field a continuous dimension, and also set its geographic role. It has the effect of snapping lat/long pairs to a grid. As an alternative to rounding, you can look into the hexbinx() and hexbiny() functions.
For a heat map based on square or hex grids, you may want to try using (partially transparent) colors instead of size to indicate density.
I have a basic line graph. I want this line to be green when the values are increasing (i.e., current>previous) and red when they are decreasing. Is it possible?
I am aware of this workaround: instead of the original values, I will show the difference between current value and the previous value. This way, if in the new graph I have something greater than 0, it means the original graph is ascending. And I am able to show different colors based on a threshold (so, in the new graph, when value>0, I will use green, and I will know that part of the graph corresponds to an increasing area in the original graph). I am interested in a resolution for the original problem, though.
I want to hide all elements in my model with mass less than a value. Is it possible?
I found only way to see mass of elements by creating set for each element in History Output, but it sounds stupid because the number of elements.
Is there any way to do it?
You can create a display group based on the currently displayed field output variable. Element mass isn't available, but element volume is. (you have to request EVOL as an output before running the analysis). you should already know the density.
You should display the elements above your threshold volume. Then create a display group by selecting the elements currently visible in the viewport. This will ensure that you can then plot other field outputs while keeping the same elements displayed.
I need to draw multiple plots. How can I set the position of each plot in codes instead of setting one by one in storyboard?
The image I want to achieve is here. In this image, each small curve is a plot. So there are in total 20 x 15 small plots. I need to position and feed different data for each of them. But I don't want to set their positions one by one coz it's tedious.
Do you need to allow user interaction or frequently update the plots? If not, your best bet is to use one graph with a single plot. Render it into small images, once for each plot, changing the data each time. Draw the images into a view laid out in your grid.
If you can't use the image approach, you'll probably run out of memory long before setting up 300 individual graphs. Instead, use one graph with a single plot space if possible. Offset and scale the data values for each plot so they appear in the appropriate section. Use as few plots as you can (one for each line style). Separate the line segments with empty (NAN or nil) data values.
Scenario:
1) Three plots: One 'datum' plot (default) and three comparison plots; each with their own Y Ranges.
The user could choose either:
2a) One stand-alone'datum' plot (default) or...
2b) A combo of {datum & 1 comparison plot}: 2 plots sharing a combined range (max/min Y of both).
All three plots are initially created/graph.
They are to be toggled to displayed per their ranges on demand.
Problem: Changing the graph's Y-Range appears to have an unfavorable (or no) effect: sometimes using the wrong Y-Range (e.g., the combo comparison plots is still using the default datum y-range).
Question: What is the best way to change the graph's Y-Range per demand to accommodate the plot scenarios?
Note: I've been toggling the plots via add/remove plot from graph. Essentially, I just re-assign the new Y-Range/graph when I add the new plot(s).
The plot(s) should change to reflect the new xRange or yRange whenever you change them. If you're modifying the existing range, remember that plot ranges are immutable. You need to make a mutable copy of the existing range before modifying it and assigning the new range to the plot space.