Is it possible to access the current username to filter a dataset?

Hi!

I’m trying to create a dashboard where I have a control panel and I want one of the controls to be limited by what the user currently visiting the dashboard can see. I have a dataset which has the users and the stores that they are authorized to filter. Ex.:

User_name | Store_name
Joe | Store 1
Joe | Store 2
Sally | Store 1

And so, in the control panel, if Jose is visiting the dashboard he should be able to see the options Store 1 and Store 2 and Sally should only be able to see Store 1. The problem is that I’ve not been able to make this work. I’ve tried the approach descripted in here but it’s not working. I thought that I could filter the dataset based on the user accessing the dashboard but I have no idea if it is possible. I tried to access to access the parameter with the user name in the same way I would when creating a calculated field but with no sucess.

Thank you!

Create a RLS dataset with
quicksight_user_name. | store name

Please make sure that you get the full quicksight user name from the user management portal (manage quicksight–>users).
After then, apply this RLS dataset on top of your original dataset. It should work. Using row-level security (RLS) with user-based rules to restrict access to a dataset - Amazon QuickSight

2 Likes

I believe that solves it, but I still have an underlying issue with this: I have a dropdown control where all the options are available (ex.: even if it was Sally consulting the dashboard, she would still have the option to pick Store 2, despite she would not see any data). Is there any way to filter these options on the control filter as well?

1 Like

@Hugo , You can do some tweak:

  1. Create a dataset with only Store. Do NOT apply RLS on this dataset. Call this dataset “control datasets”
  2. In analysis, include the “control datasets”, as well as the dataset with RLS, call “fact dataset”.
  3. For the visuals, create them from the “fact dataset”.
  4. Create a parameter called “Store”. Create a control based on “Store”. The control elements from Store of “control datasets”.
  5. Create filter to filter on the visuals. Let filter to be custom list and get the list from parameter “Store”
    image
  6. All set!
3 Likes

Thanks for this suggestion @Ying_Wang , @Hugo . I have similar requirement to implement. Trying this option.
Few qq-

  1. will “fact dataset” have both the columns User_name & Store_name ?
  2. what Row Level Security I have to apply ?
    My requirement is-
    If Joe opens my report, he will see all data related to Store 1 and Store 2
    and, if Sally opens my report, she will see all data related to Store 1 only
    Looking forward to your help please. Many Thanks!