5 Replies Latest reply on Feb 26, 2018 10:27 AM by Antonio S

# Create Sets for Top N and Others by Department

Excuse any terminology I might use incorrectly in advance please.

I have used this article Create Sets for Top N and Others | Tableau Software to get my Top N products and Others for my entire data set however I want to "compute using pane" on my department, I assume I have to apply a LOD Fixed Calculation. How would I go about doing that and where? An exact calculated would be nice.

I want my viz to have the data structured this way at the end:

• ###### 1. Re: Create Sets for Top N and Others by Department

Could you include a workbook please?

• ###### 2. Re: Create Sets for Top N and Others by Department

This is tricky one.

I created parameter

[Rank]

rank_unique(sum([Sales]))

.

[Filter]

[Rank]<= [TOP N] or last() = 0

[Sales 2]

if [Rank]<= [TOP N]

then sum([Sales])

else running_sum(if [Rank]>[TOP N] then sum([Sales]) end)

end

Thanks,

Shin

3 of 3 people found this helpful
• ###### 3. Re: Create Sets for Top N and Others by Department

Could you please post the logic of TOP N Name (Calculated Field)

• ###### 4. Re: Create Sets for Top N and Others by Department

[TOP N Name]

if [Rank]<=[TOP N] then attr([Prod. Name]) else "Other" end

// if [Rank] <= 3, show product name, else show "Other".

Because Rank is recognized as aggregated, need to add "attr".

Thanks,

Shin

1 of 1 people found this helpful
• ###### 5. Re: Create Sets for Top N and Others by Department

For some reason, I am getting last as other values(products in the example) that is not Other

Do you know why is happening?

Thanks

antonio