How can I create a calculation that returns only the maximum level achieved for each user? Creating a MAX(value) pill generates a single data point, in this case 4, which is not what I'm looking for. Creating a discrete (value) pill as a dimension includes every value for every user, also not what I'm after. I'd like to use the calculation to create a bar chart (distinct count of users vs. maximum value) where each bar is a count of users at their maximum value. In the example above, the bar at value "1" would have 1 user, value "2" would have 3 users, value "3" would have 0 users, and value "4" would have 2 users. Thanks!

There are quite a few routes to get the result you are asking for here, an aggregation of an aggregation. This can be done with stacked bar marks and a reference line, or a WINDOW_SUM() table calc.

Attached are examples two. If your situation is more complex or you have other requirements or constraints, another route may be a better fit.

Notice on the table calc worksheet that the pill MAX(Value) is set to be ignored in table calculations, this causes it to be used for partitioning, and the compute using (addressing) of the table calc pill is set to User. To get the label at the end of the bar, stacked marks was turned off.

The table calc route would enable derivative calculations or other display options not available with the simple stacked bar marks.

I just found this topic today, and it helped me resolve an issue that I had been dealing with for a long time. Unfortunately I don't understand how the calculation below works. Would you please be able to explain? Or point to a place where I could learn these functions?

Hi Aaron, thank you very much for the thorough explanation. I think I get it. In my use case, what I want is not necessarily the first item in the partition, I want the item with the maximum value for that field. So does sorting by this field influence what this calculation gets?

I just wonder if you have ever discussed it here. I am just looking for a function to create a calculated field which could exclude two highest and two lowest values in a given set. thank you in advanced!