Urgent.News

What's breaking now, across thousands of outlets.

Tech

Ranking every Texas bar by alcohol sales with one SoQL query

Texas requires every mixed-beverage permit holder to report monthly liquor, wine, beer and cover-charge receipts. The Comptroller publishes all of it on data.texas.gov (dataset naix-2893 ). That's millions of rows going back years, one row per location per month. The raw data answers "what did venue X report in March?" What people actually want to know is "who are the biggest and fastest-growing…

Texas law mandates that every mixed-beverage permit holder submit monthly reports detailing liquor, wine, beer sales and cover-charge receipts. The Comptroller of Public Accounts makes this extensive dataset available on data.texas.gov, which contains millions of rows of information that span years. While the raw data can answer specific queries like "What did venue X report in March?" or "Who are the biggest and fastest-growing venues in a given market?", it can be cumbersome to sift through without some assistance.

Fortunately, the Statewide Query Language (SoQL) allows for the creation of more efficient queries that can extract the most relevant information. By using conditional statements within aggregate functions, it is possible to calculate multiple windows of data in a single pass. For example, a SoQL query can be constructed to compute total receipts for the trailing 12 months and the prior 12 months for each venue. This enables the ranking of Texas venues based on their alcohol sales over time.

The SoQL query provided in the source material demonstrates how to retrieve this data. It selects the taxpayer number, location number, and location name, then calculates the total receipts for the trailing 12 months and the prior 12 months using conditional sums. By filtering the data to the period between September 30, 2024 and August 31, 2026, the query can be ordered by the trailing 12 months' receipts in descending order.

This data reveals interesting insights. Houston tops the list with $1.57 billion in alcohol sales, followed closely by Dallas with $1.22 billion, Austin with $1.16 billion, San Antonio with $0.83 billion, and Fort Worth with $0.46 billion. The largest single venue, in terms of alcohol sales, is AT&T Stadium in Arlington, reporting $38.3 million. Lubbock's #1 venue is United Supermarkets Arena, with sales of $7.8 million.

For those who want to access this data without the technical expertise to run complex queries, an Apify Actor has been created. This tool allows users to run the query from a form or schedule it automatically. Additionally, there is a companion Actor that tracks new business leads in Texas, including newly formed LLCs. These resources make it easier for businesses and analysts to stay informed about the alcohol sales landscape in Texas.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Sunday 11 October →