Filter data in analysis

Hi,
I want to put a filter on a field in an analysis/dashboard to limit the values where I use the field in a filter and show it as a control to the user.
For example, Year contains 2009,2010,2011,2012,2013, 2014. I want to exclude the years 2009, 2010, and 2011 and show the Year filter to the use so he can only be able to choose from 2012, 2013, 2014.
How to do that?

Hi @saadnayef

Welcome to the Quicksight community and thank you for posting your question.

If you want to display different years in a filter for different users — for example, User A should only see 2009 and 2010, while User B should see 2012, 2013, and 2014 — consider using Row-Level Security Rules - Using row-level security with user-based rules to restrict access to a dataset - Amazon QuickSight

OR If you want all users to see only 2012, 2013, 2014 data then please create a calculated field that includes only these years and then you can add this calculated field as a filter on top of your visual.

Please let me know if that helps or if you have any additional questions

Thank you,
Shravya

1 Like

Hi @saadnayef

One easy way is to create your Parameter with a list of years you want to display in the Static multiple default values. So, you are not deriving the years from the dataset, so it static and requires maintenance.

See an example below for a different purpose that I built where I wanted to exclude a specific Task Type which is available in my dataset, but I did not want my users to see/filter. So, I created a parameter by listing the members that I want in the parameter.

What to do after creating the parameter?

I want to exclude some values and show all others. I created a parameter and a calculated field to not show when the values are in the parameter. But I couldn’t know how to not show null using ifelse in the calculated field.

Hello @saadnayef

So, after creating the parameter → add Year field as a filter to your visual and connect that with parameter created (you can choose ‘Use Parameter’). Then route to parameter and click on 3 dots and do ‘Add control’ to the sheet.

Another way is to create a custom SQL Query and just write a SQL query to ignore the specific years you want.

Thank you,
Shravya

Hi @saadnayef,
It’s been awhile since we last heard from you, did you have any additional questions regarding your initial post?

If we do not hear back within the next 3 business days, I’ll go ahead and close out this topic.

Thank you!