I have a data set of trees. Each tree has a species (one of 500) and a condition (one of 7: good, poor, dead, etc.). I'm trying to make a stacked bar chart that shows, for each species, the proportion of trees with each of the conditions. For example,
tree 1: maple good
tree 2: maple poor
tree 3: maple good
tree 4: oak good
tree 4: oak poor
If I do something like: Count(Condition), I just get:
maple 3
oak 2
That is, it counts the number of trees of each species that have any value for condition (which is all of them). How can I show the results:
maple
good 2
poor 1
oak
good 1
poor 1
I'm really new to this, so grateful for any help.
Hi, add both Tree and condition as dimensions. Then add count(condition) as expression.
Display as stacked bar chart
Hi, add both Tree and condition as dimensions. Then add count(condition) as expression.
Display as stacked bar chart
Hi,
assume, you have data like this,
Data:
LOAD * INLINE [
F1,F2,F3
tree 1,maple,good
tree 2,maple,poor
tree 3,maple,good
tree 4,oak,good
tree 4,oak,poor
];
Create pivot chart and create aggregate field like below,
Dimensions : F2 & F3
Measure: aggr(Count(F1),F2,F3)
Thanks,
Deva
Thanks so much to you both! Both answers worked fine, but I realized I was a little unclear--the bar chart was just what I was looking for. Very grateful for the quick and thorough help.
~Kelaine