Top N filter (parent or child)

Hi team ! looking for some assistance please. I am trying to add a filter to a dashboard. Top 25 cities, by total_active_users. The aim is to have all my tables in the dashboard show the same top 25 cities, but unfortunately this is proving a challenge. I have reviewed your notes and could see filters (both parent and child filters) but couldnt see the answer I needed.

I also thought of a rank function in the .aml file using this code:
definition: @sql RANK() OVER (PARTITION BY {{city}}, {{event_date}} ORDER BY COUNT(DISTINCT {{ #SOURCE.active_user_id }}) DESC);;

but was getting errors too. Do you think this is possible?

1 Like

Hi @Grant_Orchard,

Interesting use-case! Thank you for raising this.
May I confirm again that you would like to: first rank by total_active_users to get the top 25 cities, and then use this output as the value input for the cities filter in your dashboard?
Please correct me if I missed anything.

If that’s correct, then this use-case indeed can’t be addressed by parent-child filter. Unfortunately at the moment our Reporting functionalities cannot support this case either.
However, there might be a workaround using Holistics’s Modeling layer… I’m discussing it with our team right now, and will get back to you with updates soon.


1 Like

In the meantime, may I ask if it makes sense for you to set up Condition as City name by top 25 total_active_users in each of the table, @Grant_Orchard?

In case you are not familiar, I attach the Document and a demo image here:

1 Like

Hi there - Apologies for delay.

We actually used this method before reaching out to yourselves. I think issue was also the stakeholders were using 2 different models and we tried to apply a filter to filter to TOP 25 countries.

We’ve moved to PROD as we couldnt see a solution, but will keep watching for advancements with Holistics

Thanks Team!

1 Like

Thanks for getting back to me, @Grant_Orchard.

We were discussing internally, and concluded that the most sensible solution for this would be to support Top N Filter at dashboard level.
I’ve added it to our product backlog now. Will make sure to let you now of any updates.
Thanks, Grant.

1 Like