๐๏ธ Louisville Payroll Analytics โ Part 4
๐ From SQL Results to Visual Story
With the SQL layer stable (tables, indexes, views), it was finally time to switch hats and think like a BI developer.
The goal wasnโt to produce 20 random charts, but a small dashboard that a nonโtechnical stakeholder could actually use.
I decided on four core views:
- Yearly Trend: headcount and overtime % over time
- Salary by Department (2024): total payroll and average salary
- Overtime by Department (2024): cost and intensity of overtime
- Salary Variance by Job Title (2024): internal pay ranges
๐งฉ Connecting Tableau to PostgreSQL
Steps:
- Data โ PostgreSQL โ connect to
louisville_payroll - Use the analytical views (
v_department_summary,v_overtime_analysis,v_top_earners) instead of raw tables - Verify field types (numeric vs string vs date)
- Create a data source per thematic area (trend, department metrics, job title metrics)
Working directly on the views kept Tableau calculations clean and pushed heavy work down to SQL, where it belongs.
๐ View 1 โ Yearly Trend
A dualโaxis chart:
- Area: number of employees over time
- Line: overtime as a percentage of total payroll
This immediately shows if overtime is growing faster than headcount, which is a red flag in any organization.
๐ข View 2 โ Salary by Department (2024)
Horizontal bar chart:
- Xโaxis: total payroll
- Yโaxis: department (sorted descending)
Tooltips include:
- employee count
- average salary
- share of total payroll
This view answers โwho costs the most?โ at a glance, without touching SQL.
๐ฅ View 3 โ Overtime by Department (2024)
Same structure as salary view, but:
- Bars = total overtime cost
- Color = overtime % of total payroll
This makes it impossible to ignore departments where overtime is both large in absolute terms and heavy as a share of payroll.
โ๏ธ View 4 โ Salary Variance / Inequality
For this, I used a derived dataset (like Salary-Variance-per-Job-Title), built from SQL:
- Bars show salary range (max โ min) per job title
- Filter to job titles with at least N employees
- Tooltip shows min, max, mean and std dev
This is the visual counterpart of the SQL analysis on internal equity.
๐ Dashboard Layout
The final dashboard layout:
The work is directly tied to immediate and simple questions:
How big is the payroll?
Where is overtime concentrated? Which roles have the largest internal gaps?
๐ฏ Next Steps
Link it with the GitHub repo in the README.
Write a final โretrospectiveโ post about what worked and what didnโt.
To be continuedโฆ