TopN using PREFILTER

Hi Everyone,

I am working on migration of dashboards from Tableau to Quick. In Tableau there is Top5 filter been used by sum of a measure.

I tried to do the same in Quick using Topn filter.

I noticed that there is difference in data while using other filters.

In Tableau, once top n filter is applied, the values won’t change. Only the measures will change.

In Quick, everything gets changed.

Basically, I need to do a PRE-FILTER using rank so that I can mitigate this issue.

But I am not able to use PRE FILTER with aggregation

My calculation : denserank([sum(sales) DESC],[],PRE_FILTER) - this calculation doesn’t work because sum is used. If I use sumOver with PRE_AGG also it won’t work because we can’t use PRE_FILTER with PRE_AGG.

Could you help me on this? TopN Attaching arena link for suggestions.

Thanks,

Kripa

Hi @Kripa,

I am not sure if the same result will arise in this instance, but could you try creating both a similar calculated field and a filter on the dataset-prep layer instead? I think that should work and give you a result that resembles Tableau output. Please let me know if you have any specific questions regarding this process.

Thank you!

Hi @WLS-Luis ,

Creating top n filter in dataset level will filter the whole dataset right? I don’t want that since there are other visuals also.

My requirement is that topn filter should be fixed and doesn’t change once applied. When the other filters are applied, only the data within those topn values should change and the topn values should not change

Hi team,

Any suggestions on this?

Thanks,

Kripa

Hi @Kripa,

After further looking into dataset prep filtering, I realize that this is not a viable workaround since it currently only offers filtering based on “Custom Filter” and “Custom Filter List.”

What might be the cleanest option is updating your data via SQL by adding another column that retrieves the top n values (which will essentially make this PRE_FILTER). From there, you can create a filter on your respective visual(s) that only populates data based on that new column.

Let me know if this workaround helps or if you have any specific questions!

Hi @Kripa,

Just checking back in since this thread hasn’t received a response in a while. Was my most recent reply helpful to you and/or were you able to find a solution yourself in the meantime? Please help the community by marking this answer as “Solution” or following up in general within the next 3 business days!

Thank you!

Hi @Kripa,

Since I haven’t received any further updates from you, I’ll treat this inquiry as complete for now. If you have any additional questions, feel free to create a new post in the community and link this discussion for context.

Thank you!