0
0
Tableaubi_tool~15 mins

Database connections (SQL Server, PostgreSQL) in Tableau - Real Business Scenario

Choose your learning style9 modes available
Scenario Mode
👤 Your Role: You are a business intelligence analyst at a retail company.
📋 Request: Your manager wants you to create a sales dashboard by connecting Tableau to the company databases. The sales data is stored in SQL Server and the customer data is stored in PostgreSQL.
📊 Data: You have access to two databases: SQL Server contains the Sales table with columns OrderID, CustomerID, OrderDate, Product, Quantity, and SalesAmount. PostgreSQL contains the Customers table with columns CustomerID, CustomerName, Region, and CustomerType.
🎯 Deliverable: Create a Tableau dashboard that connects to both databases, combines sales and customer data, and shows total sales by region and customer type.
Progress0 / 6 steps
Sample Data
OrderIDCustomerIDOrderDateProductQuantitySalesAmount
100120012024-01-05Widget A10500
100220022024-01-10Widget B5300
100320032024-01-15Widget A7350
100420042024-01-20Widget C3150
100520052024-01-25Widget B8480

CustomerIDCustomerNameRegionCustomerType
2001Alpha CorpNorthRetail
2002Beta LLCSouthWholesale
2003Gamma IncEastRetail
2004Delta CoWestWholesale
2005Epsilon LtdNorthRetail
1
Step 1: Open Tableau and create a new data source connection to the SQL Server database.
In Tableau, select 'Microsoft SQL Server' as the connector. Enter the server name, database name, and your credentials. Connect to the Sales table.
Expected Result
Tableau connects to SQL Server and loads the Sales table with columns OrderID, CustomerID, OrderDate, Product, Quantity, SalesAmount.
2
Step 2: Create a second data source connection in Tableau to the PostgreSQL database.
In Tableau, select 'PostgreSQL' as the connector. Enter the server name, database name, and your credentials. Connect to the Customers table.
Expected Result
Tableau connects to PostgreSQL and loads the Customers table with columns CustomerID, CustomerName, Region, CustomerType.
3
Step 3: Join the Sales and Customers tables in Tableau using a common key.
Use Tableau's Data menu to create a relationship between Sales.CustomerID and Customers.CustomerID.
Expected Result
Sales and Customers data are linked in Tableau, enabling combined analysis.
4
Step 4: Create a calculated field in Tableau to sum SalesAmount.
Create a calculated field named 'Total Sales' with formula: SUM([SalesAmount])
Expected Result
A measure 'Total Sales' is available to use in visualizations.
5
Step 5: Build a dashboard showing total sales by Region and CustomerType.
Create a worksheet with Rows = Region, Columns = CustomerType, and Values = Total Sales. Use a bar chart or heat map for visualization.
Expected Result
Dashboard displays total sales grouped by region and customer type.
6
Step 6: Add filters for Product and OrderDate to the dashboard for interactivity.
Add filter controls for Product and OrderDate fields to the dashboard.
Expected Result
Users can filter sales data by product and date range on the dashboard.
Final Result
Sales Dashboard

Region    | Retail Sales | Wholesale Sales
------------------------------------------
North     | $980         | $0
South     | $0           | $300
East      | $850         | $0
West      | $0           | $150

Filters: Product [All], OrderDate [All]
North region has the highest retail sales totaling $980.
Wholesale sales are mainly in South and West regions.
Product filters allow detailed sales analysis by product type.
Date filters enable viewing sales trends over time.
Bonus Challenge

Create a live data connection that refreshes sales data daily and alerts when sales drop below a threshold.

Show Hint
Use Tableau's data extract refresh scheduling and set up conditional alerts on the dashboard.