In SAS Visual Analytics, reports can present data from multiple users, departments, or business areas within a single view. In some scenarios, however, users may want to focus first on data that is relevant specifically to them while still having the flexibility to view all available data when needed. For example, a report might contain records owned by many users, but each user would prefer to quickly filter the report to records associated with their own user ID. To improve usability, we’ll explore how to combine a user identity lookup table, row-level security (RLS), data source mapping, and report interactions to create a simple “My Data / All Data” filtering experience in SAS Visual Analytics. This article is going to walk you through detailed steps on how to achieve this objective.
Main Section:
Let me first show you what the result would look like in an example.
This is a simple VA report that contains a button bar and a list table. The table only contains two variables, which are book name and author name. Here is the demonstration on the two conditions you can see with the example report, helping you to dynamically filter the report by the logged-in user.
Condition1 : If you click the button bar, it automatically filters to display the data rows specific to your logged-in user. In my case, it displays the book name with a author name that is identical to my id.
Condition2 : If you unclick the button bar, it displays all the book name from the source table.
Here are the steps on how you can create such kind of VA report in a simplified example:
cas cs;
filename idresp temp;
proc http
url="https://sas-identities/identities/users?limit=100000"
oauth_bearer=sas_services
out=idresp
;
headers "Accept"="application/json"
;
run;
libname idjson json fileref=idresp;
libname public cas caslib="public";
data public.userlookup_session(keep=id name replace=yes);
set idjson.items;
run;
proc cas;
action table.droptable /
caslib="public",
name="userlookup",
quiet=TRUE;
action table.promote /
caslib="public",
name="userlookup_session",
targetcaslib="public",
target="userlookup",
drop=TRUE;
run;
action accessControl.assumeRole /
adminRole="SUPERUSER";
action accessControl.updSomeAcsTable /
acs={{
caslib="public",
table="userlookup",
permission="SELECT",
permType="GRANT",
identityType="GROUP",
identity="*",
filter="id='SUB::SAS.Userid'"
}};
run;
quit;
cas cs terminate;
By combining a user identity lookup table with row-level security and report interactions, users can quickly focus on data relevant to them while retaining the flexibility to view all available data. This approach creates a more personalized reporting experience, simplifies navigation, and makes SAS Visual Analytics reports more intuitive and user-friendly.
Visit the Tips & Tricks page for setup guidance, demos, and practical examples that show how Copilot supports your workflows.
The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.