Lets Viz Technologies Logo
Home
Dashboards
Contact
Get Demo
Lets Viz

Custom Gen AI + BI Solutions to Automate Workflows and Unlock Insights. We help businesses automate repetitive processes and gain real-time insights through AI-driven workflows and intelligent dashboards.

Company

  • About
  • Careers
  • Contact

Services

  • AI Automation
  • Custom Dashboards
  • BI Consulting
  • IT Outstaffing

Dashboards

  • Finance
  • Marketing
  • Sales
  • Operations

Learn

  • Blog
  • Tech Tutorials

Legal & Social

  • Privacy Policy
  • Terms & Conditions

Contact Us

Location

Noida, Uttar Pradesh 201301
WeWork Berger Delhi One, C-001/A2, Sector 16B

Phone

+91 0124 502 5592

Email

info@lets-viz.com

Review Us On

Clutch logoTrustpilot logoGoogle Reviews logo

© 2026 Lets Viz Technologies. All rights reserved.

Dashboard

SQL PARTITION BY ( ) Clause

SQL PARTITION BY ( ) Clause
January 26, 2023·By Lets Viz·2 min read
DashboardReporting

This PARTITION BY ( ) Clause is used to partition the rows and group them into the table. The PARTITION BY ( ) Clause is useful when the query is performed in a particular group. This clause is inside the OVER ( ) clause with a particular group of rows. The groups of rows formed by the clause are known as WINDOW. The clause is worked by the Window function as RANK (), LEAD (), etc.

  • Syntax for PARTITION BY ( ) Clause –

WINDOW_FUNCTION(column_name) OVER (PARTITION BY(column_name))

ORDER BY Clause can also be used with the PARTITION BY () clause.

DEMO TABLE –

Product Table

Category Region City Country Sales Customer_name
Office Supplies Central Chicago United States 15.696 Suzanne McNair
Technology East New York City United States 539.97 Amy Hunt
Office Supplies East New York City United States 22.58 Amy Hunt
Office Supplies East Dover United States 16.52 Emily Phan
Office Supplies East Dover United States 671.94 Emily Phan
Technology West Aurora United States 169.064 Tracy Poddar
Office Supplies West Aurora United States 168.624 Tracy Poddar
Office Supplies East Long Beach United States 19.44 Anthony Rawles
Office Supplies West Pasadena United States 31.92 Helen Andreada
Furniture West Pasadena United States 433.568 Helen Andreada

Example – Consider the above Product table of the Customer database and evaluate the Sum of Sales for each Category.

SELECT Category,Region,City,[Country/Region],[Customer Name], SUM(Sales) OVER (PARTITION BY Category ) AS Total_sales FROM [dbo].[Products];

The output after executing the above statement is as shown –

Category Region City Country Customer_ID Customer_name Total_sales
Office Supplies Central Chicago United States SM-20950 Suzanne McNair 946.72
Office Supplies East New York City United States AH-10465 Amy Hunt 946.72
Office Supplies East Dover United States EP-13915 Emily Phan 946.72
Office Supplies East Dover United States EP-13915 Emily Phan 946.72
Office Supplies West Aurora United States TP-21565 Tracy Poddar 946.72
Office Supplies East Long Beach United States AR-10825 Anthony Rawles 946.72
Office Supplies West Pasadena United States HA-14920 Helen Andreada 946.72
Technology East New York City United States AH-10465 Amy Hunt 709.034
Technology West Aurora United States TP-21565 Tracy Poddar 709.034
Furniture West Pasadena United States HA-14920 Helen Andreada 433.568

Follow us on Twitter, Facebook, Linkedin, and Tableau Public to stay updated with our latest blog and what’s new in Tableau.

Automate data analysis pipeline and create report ready dashboards

If you are looking forward to getting your data pipeline built and setting up the dashboard for business intelligence, book a call now from here.

Related blogs

Executive Dashboard Best Practices: How to Design Dashboards Leaders Actually Use
Dashboard
Executive Dashboard Best Practices: How to Design Dashboards Leaders Actually Use

TL;DR: An executive dashboard must deliver clarity, context, and confidence — fast. The best executive dashboards focus on business outcomes, not just metrics. Follow these best practices: align KPIs with...

Data AnalyticsKPIReporting
6 min read
Read More
Data Quality that Scales: 12 Tests to Add Before Any Power BI Dashboard Goes Live
Dashboard
Data Quality that Scales: 12 Tests to Add Before Any Power BI Dashboard Goes Live

TL;DR: Before publishing any Power BI dashboard, run a 12-step data quality validation checklist to ensure accuracy, consistency, and trust in your analytics. From schema consistency to null handling and...

Business IntelligencePower BIReporting
6 min read
Read More
An Introduction to Aggregators in Make: How I Learned to Group, Combine, and Simplify Data
Dashboard
An Introduction to Aggregators in Make: How I Learned to Group, Combine, and Simplify Data

When I first started building scenarios in Make, I often ran into the same problem: I had too much data scattered across multiple bundles, and I needed a way to...

Business IntelligenceReporting
8 min read
Read More

Ready to Transform Your Data?

Book a free demo and see how we can help you unlock insights from your data.

Book a Demo