Different group by based on the domain of user

HI, I have a requirement that should change the group by parameters, based on the domain of the logged in user.
I tried to use userName() but that is not available, I have an enterprise edition and have applied row level security on my data set. Please help on this

Hi @arunsunny123

Welcome to the community!

QuickSight doesn’t have auserName() function for direct use in calculated fields. However, since you’re working with the Enterprise Edition and have applied row-level security (RLS), you can implement dynamic groupings based on the user’s domain by using a combination of row-level security and filters.

Ensure that your dataset is configured with row-level security (RLS) based on user attributes, such as their email address. You can create a mapping of users to specific groups in your RLS dataset.

Add a new field to your dataset that extracts the domain part of the user’s email. Use a calculated field to group your data dynamically based on the user’s email domain.

Example: split(email_address, '@', 2)

You can apply a filter to the visualizations based on the domain of the logged-in user. With RLS applied, each user will only see the data they are allowed to access, and the grouping logic will be based on the filtered data.

Please refer the below documentation this might be helpful for you.

Hope this helps!

1 Like

Thanks. My RLS table has only two parameters. USer group and partner name and my data set has only partner name. If i am able to get this user group as well,i can work this out.