I appreciate any help that can be offered.
I have a table that shows skus including size, price and quantity listed vertically. I would like to generate a query that gives me quantity totals per style, grouping all items whose sku are the same before the first dash from the left.
table 1
result
thanks again
[Solved] Total quantity by style
-
- Posts: 54
- Joined: Sun Sep 04, 2016 9:40 pm
[Solved] Total quantity by style
Last edited by cartoonjazz on Mon Jul 10, 2017 9:56 pm, edited 1 time in total.
openoffice 4.1.2 windows 10
-
- Volunteer
- Posts: 1547
- Joined: Wed Jun 24, 2015 12:56 am
- Location: Colorado, USA
Re: total quantity by style
Try something like
You may need to adjust the column names to match those in your table.
Code: Select all
SELECT LEFT("SKU", LOCATE( '-', "SKU")-1) AS "Style", SUM("qty") AS "Total" FROM "Table1" GROUP BY "Style";
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
-
- Posts: 54
- Joined: Sun Sep 04, 2016 9:40 pm