Proof of concept to show the parameter will refresh on opening in Desktop or Web-Authoring but fails when used as a regular workbook on a server.
This workbook uses the TableauServerUser value to pass the username to MySQL and retrieve data allocated to the user. In order to recreate this issue, you will need to pass a user value registered in the Tableau (‘Aleksandr.Skobelev’, ‘John.Smith’, or ‘Jane.Doe’).
- Create a data connection (DC1) as a Tableau Extract
- Create another data connection (DC2) as live
- Create parameter to select Region based on values brought back by DC2 and set to auto refresh when workbook opens
- Create a visualization from DC1, using the parameter as a filter
- Example:
- Create calculated field named “Fltr Region” with logic of:
[Region] == [Parameters].[Region]
- Use calculated field as filter and allow only
TRUE
values
- Create calculated field named “Fltr Region” with logic of:
- Example:
- Verify Parameter refreshes and shows option when closing and reopening the workbook
- Publish Workbook to Server
- Open Dashboard in Tableau Server
- Verify Parameter does not refresh and shows blank value
- With the dashboard open in Tableau Server, click “Edit” to enter Web-Authoring
- Verify Parameter refreshes and shows options
-- create base tables with sample data
CREATE TABLE IF NOT EXISTS tableau_pub.regions (
id INT NOT NULL,
region VARCHAR(200) NOT NULL,
created_at DATETIME NOT NULL,
modified_at DATETIME NOT NULL
);
INSERT INTO tableau_pub.regions VALUES
(1, 'Africa', NOW(), NOW()),
(2, 'Asia', NOW(), NOW()),
(3, 'Europe', NOW(), NOW()),
(4, 'Middle East', NOW(), NOW()),
(5, 'Ocenia', NOW(), NOW()),
(6, 'The Americas', NOW(), NOW())
;
CREATE TABLE IF NOT EXISTS tableau_pub.user_mapping (
id INT NOT NULL,
user_name VARCHAR(200) NOT NULL,
region_id INT NOT NULL,
created_at DATETIME NOT NULL,
modified_at DATETIME NOT NULL
);
INSERT INTO user_mapping VALUES
(1, 'Aleksandr.Skobelev', -99, NOW(), NOW()),
(2, 'John.Smith', 1, NOW(), NOW()),
(3, 'Jane.Doe', 3, NOW(), NOW())
;
-- Initial SQL for data connection to populate Region parameter
DROP TABLE IF EXISTS user;
CREATE TABLE IF NOT EXISTS user AS (
select
um.user_name,
um.region_id,
r.region
from tableau_pub.user_mapping as um
inner join tableau_pub.regions as r on r.id = um.region_id
or um.region_id = -99
where
um.user_name = [TableauServerUser]
);
-- Custom SQL Query to populate Region Parameter
select * from tableau_pub.user