ISMEMBEROF("Managers") is true when the viewer is in the Managers group on Tableau Server or Cloud. In SQL, groups live in an entitlements table (user, group), and the test is an EXISTS against it for the viewer. The sample's entitlements list mai and linh as Managers and bao in Field; the stand-in viewer TIN\analyst is in no group.
Updated · Checked on the xmetric engine
What is the syntax?
ISMEMBEROF("group")
group
a string constant: the Tableau Server or Cloud group name, such as 'Managers'.
Returns a boolean: true when the viewer belongs to the named Tableau group. The same value on every row.
What does it return, and what is the SQL?
Each example runs on the same 6 sample rows twice: the Tableau formula on the xmetric engine, and the SQL in DuckDB.
Is the viewer a manager?
Tableau
ISMEMBEROF('Managers')
SQL (DuckDB)
WITH viewer AS (
SELECT'TIN\analyst'AS username
), entitlements(username, grp) AS (
VALUES ('mai', 'Managers'), ('linh', 'Managers'), ('bao', 'Field')
)
SELECTEXISTS (
SELECT1FROM entitlements e, viewer v
WHERE e.username = v.username AND e.grp ='Managers' ) AS result
FROM input
ORDERBY id
False on every row: the viewer has no entitlement rows.
Result
false
false
false
false
false
false
✓ The Tableau formula and the SQL return the same 6 rows.
How do managers see every row and others only their own?
WITH viewer AS (
SELECT'TIN\analyst'AS username
), entitlements(username, grp) AS (
VALUES ('mai', 'Managers'), ('linh', 'Managers'), ('bao', 'Field')
)
SELECTCASEWHENEXISTS (
SELECT1FROM entitlements e, viewer v
WHERE e.username = v.username AND e.grp ='Managers' ) OR i.Owner = (
SELECT username
FROM viewer
) THEN i.Sales
ENDAS result
FROM input i
ORDERBY i.id
The viewer is not a manager, so only rows 1 and 4, their own, keep a value.
Owner
Sales
Result
TIN\analyst
420
420
mai
310
null
bao
150
null
TIN\analyst
275
275
90
null
linh
515
null
✓ The Tableau formula and the SQL return the same 6 rows.
Where does a straight translation go wrong?
Common mistake
Why does joining to the entitlements table drop every row?
An inner join keeps only rows with a matching entitlement. The viewer has none, so all six rows vanish, even the two they own. Test membership with EXISTS (or a LEFT JOIN) so the data rows stay.
Tableau
ISMEMBEROF('Managers') OR[Owner]=USERNAME()
Tempting SQL
WITH viewer AS (
SELECT'TIN\analyst'AS username
), entitlements(username, grp) AS (
VALUES ('mai', 'Managers'), ('linh', 'Managers'), ('bao', 'Field')
)
SELECT e.grp ='Managers'OR i.Owner = v.username AS result
FROM input i JOIN viewer v ONTRUEJOIN entitlements e ON e.username = v.username
ORDERBY i.id
SQL that matches
WITH viewer AS (
SELECT'TIN\analyst'AS username
), entitlements(username, grp) AS (
VALUES ('mai', 'Managers'), ('linh', 'Managers'), ('bao', 'Field')
)
SELECTEXISTS (
SELECT1FROM entitlements e
WHERE e.username = v.username AND e.grp ='Managers' ) OR i.Owner = v.username AS result
FROM input i, viewer v
ORDERBY i.id
Owner
Tableau
Tempting SQL
SQL that matches
TIN\analyst
true
null
true
mai
false
null
false
bao
false
null
false
TIN\analyst
true
null
true
null
null
null
linh
false
null
false
✓ The SQL that matches returns the Tableau result on every row; the marked cells are where the tempting SQL differs.
How do I write it in Snowflake or BigQuery?
The first example, written for each warehouse from its documentation. These are not run here; DuckDB is.
Snowflake
SELECTEXISTS (
SELECT1FROM entitlements e
WHERE e.username = $ viewer AND e.grp ='Managers' ) OR Owner = $ viewer AS result
FROM input
ORDERBY id
The database only knows the account Tableau connects with. Pass the viewer in: Tableau's Initial SQL can use the [TableauServerUser] parameter, or your app sets a session variable or a query parameter. Then filter with it, as the viewer table does on this page.
What does it return in Tableau Desktop?
When you are signed in to Tableau Server or Cloud, the server's user. Otherwise Desktop uses your local or network identity. Test row-level security as a real viewer on the server, not from Desktop.
Is everyone a member of All Users?
On Tableau Server and Cloud every user is in the All Users group, so ISMEMBEROF("All Users") is true for any signed-in viewer. In Tableau Desktop, not signed in, there are no groups to belong to.