Let's suppose I have a table:
name amt
A 1
B 3
C 8
And I now want to insert that table into another table's entry. For the purpose of this example lets say we insert that table into entry X:
name table
Z
X A 1, B 3, C 8
Y
What query can I use to do this?
The values can be comma separated, in fact I am not too worried about the format, I just need that data in the entry.
Underlying problem (Why I want to do this):
Let's say I have a group of districts. Lets call them districts A, B, and C. Now I would like to know the number of red, blue, and green houses in district A. Simple, I just make a new table that would filter out districts B and C and then count the groups of houses. So, assuming I have 8 red houses, 12 blue houses, and 2 green houses, we get the resulting table:
# of houses color
12 blue
8 red
2 green
I now want to store this in our original table for future reference. So I make a new column, and add
District Group_Data
A 12 blue, 8 red, 2 green
B
C
Now in the future I may want to do the same for districts B and C, and the same process would follow.
Any other ways to solve this problem are welcome if simpler.
Related
I am wondering whether is it possible to make a table in netlogo where the left most/first column represents the agent-x who number (i.e agent-x 1, agent-x 2 ...) and the top/first row represents agent-y 's who number (i.e agent-y 23,agent-y 37).
The distances between the agents will be added to the corresponding cells. The result will be something similar to Excel, where if column B, contains agent-x 1 and row B contains agent-y 23 the corresponding cell for column B and row B will contain the distance between the two agents (i.e 8 units).
I would like to join an Excel dataset which contain (but I don't know if its possible in here) :
The name of a course
The ID of a problem from this course (many pb per course)
The ID of a user that has submitted an answer for this problem from this course
the grade that the user has obtained at this pb from this course
What I try to achieve, it is a graph like those ! It's supposed to be call : Gradient-map, Colormap or Heat-map.
Axe x : Every problem for each course
Axe y : value of the grade (from 0 to 100)
Axe z : Number of user for each Note value
So, if for the pb A of the Course A, the dispersion is like this:
9 users have 100
21 users have 80
40 users have 60
5 users have 40
10 users have 20
15 users have 0
I would like to have every value displayed on a bar and each value would be displayed by a square. Each square having a different color regarding the value represented.
So, here, 60 would be darker than any other value (since the amount of people having this grade is the greatest) and 20 would be clearer than 0, 60, 80 & 100 but darker than 40
Then, just next to this bar, the same but for the pb B & C. Then, next to it, the pb A, B & C for the course B, etc
Move grade, name of a course, ID of a problem to Dimensions.
Put name of a course and ID of a problem on the columns.
Put grade on the rows.
Find a drop down list on the Marks tab and select Square.
Put COUNT(ID of a user) on the Color on the Marks tab
I am new to tableau and need help in figuring this out.I have a dataset in below format:
hid:id for the house the customer belong
cid:customer id
hID CustomerID
1 A
1 B
1 C
2 D
2 E
3 F
3 G
3 H
3 I
4 J
5 K
5 L
5 M
5 N
5 O
So A,B belong to house 1 so count of hid '1' is 3 so:
hid count of members
1 3
2 2
3 3
4 1
5 5
I want to show a graph in tableau as size of house that is X-axis :Size of house and Y-axis :Count no of house with same size so for above data the values as below:
Size of house no of house
1 1
2 1
3 2
4 0
5 1
The final graph should be:
In Tableau jargon, you're looking to bin based upon an aggregate value. Take a look at the following blog post for a more detailed description/walk-through.
One way to accomplish this is by leveraging talbeau's level of detail calculations. Creating a calculated field along the lines of:
{FIXED [hID] : COUNTD([CustomerID])}
You can then create a bin field by right clicking on the new field and binning based on a parameter, or a a static size (1?) of your choosing.
To create the visual, place this second bin field on the row shelf and on the column shelf drag the hID dimension and right click to convert to a measure by selecting Count Distinct.
As a side note, depending on whether you set your bin field as continuous or discrete, the 4 bin in your sample data will or will not appear.
I have the following data:
Name, Sport, Random Number
John, Tennis, 4
Jacob, Tennis, 4
Jacob, Tennis, 2
Jacob, Football, 5
I want to show a bar chart that counds up the number of People playing Sports.
X Axis: "Sport"
Y Axis: "COUNT(Number of Records)"
My current tableau is set as this:
Rows: Name
Column: SUM(Number of Records)
I want the bar graph to reflect the "Count of DISTINCT names who play the sports".
My problem with the above is that the "Tennis" for example has a count of 3 instead of 2. How do I make it so that the bar shows up as 2?
As far as I know, you cannot get a distinct count of 2 dimensions combined, natively.
However what you can do is combine two dimensions and get a distinct count of that.
Create a calculated field [NameSport] with [name] + [sport] as the formula.
Then drop it on column and use COUNTD(NameSport).
That should do the trick.
I have a table that looks like:
id aff1 aff2 aff3 value
1 a x b 5
2 b c x 4
3 a b g 1
I would like to aggregate the aff columns to calculate the sum of "value" for each aff. For example, the above gives:
aff sum
a 6
b 10
c 4
g 1
x 9
Ideally, I'd like to do this directly in tableau without remaking the table by unfolding it along all the aff columns.
You can use Tableau’s inbuilt pivot method as below, without reshaping in source .
CTRL Select all 3 dimensions you want to merge , and click on pivot .
You will get your new reshaped data as below, delete other columns :
Finally build your view.
I hope this answers . Rest other options for the above results include JOIN at DB level, or creating multiple calculated fields for each attribute value which are not scalable.