Oliver is right, the expression is correct for assigning the value if User is a dimension.
What you're describing though is not a behavior of set analysis. That is just a "filter" at the expression level and wouldn't assign any values.
The Aggr function is what you would need here. You need to match your Aggr dimensions to the external ones on your table. Try something like this:
Sum(Aggr(IF( avg(duration) < fractile(TOTAL duration,.25),1,4),User,Department))
This expression would first calculate the "rating" and the user + department level. Then if the chart it's used in only has Department as a dimension then it would sum the "rating" for users in that department. The most common mistake with Aggr (aside from using it when it's not needed) is forgetting that it's virtual table that gets passed to attach to the dimensions on the chart object. The virtual table is not attached to the rest of the data in your app. In this example if Department wasn't included in the Aggr portion there would be no way to accurately assign users to the dimension in the chart.
So far your addition to my expression works with what I am trying to do. My next step is trying to use this expression to assign values to the other tiers.
For example, I would like to have a system that assigns 1 to the the avg(duration) < .fractile(duration,.25) and then 2 to the avg(duration) between fractile(duration, .25) and fractile(duration, .50) and then follow the same pattern assigning 3 and 4.
I am not too familiar with Aggr and am not having much luck expanding this expression to include multiple ratings. Do you have any suggestions for this?
I am going to keep playing around with the expression but so far I have tried:
Sum(Aggr(IF( avg(CallDurationSeconds) < fractile(TOTAL CallDurationSeconds,.25),1,
IF( avg(CallDurationSeconds) >= fractile(TOTAL CallDurationSeconds,.25) and avg(CallDurationSeconds) < fractile(TOTAL CallDurationSeconds,.50),2),