0

I want to find the total sales of Whiskeys at a certain store in the dataset

Here's my code (Using PopSql connected to bigquery)

SELECT DISTINCT category_name, ROUND(SUM(sale_dollars)) AS Total_Revenue FROM Liquor_Sales.Iowa WHERE store_name = 'HY-VEE #3 / BDI / DES MOINES' AND category_name LIKE '%WHISK%' GROUP BY category_name ORDER BY Total_Revenue DESC;

This code gives me every category that contains 'Whisk' (I.E. Canadian whiskey, Tennessee whiskey, ETC) and their total sales but I want them to be lumped into one 'Whiskey' category with the Total revenue

1 Answers1

1

Then you simply remove the category grouping:

SELECT
    'Whiskey' AS Category_Name,
    ROUND(SUM(sale_dollars)) AS Total_Revenue
FROM
    Liquor_Sales.Iowa
WHERE
    store_name = 'HY-VEE #3 / BDI / DES MOINES'
    AND 
    category_name LIKE '%WHISK%'
Kurt
  • 1,708
  • 1
  • 3
  • 11