Hello!
I'm pulling a large quantity of data from a database using .getrows but I need to be able to split that data and display it according to category:
My array data, pipe (|) delimited, looks like this:
6087|195|25|000.96|COMMODI
TY INVENTORY|CAN|APPLE SLICES, Commodity 6/#10 Cans|
The 3rd, 4th and 5th fields are information I need for the headers of the category lists that a grouping of items will need to be separated by.
Here's the SQL query to gather the data:
sql_show = "SELECT DISTINCT ITEM.Supplier_Item_Number,
ITEM_CATEGORY.Category_ID,
ITEM_CATEGORY.Account_ID, ITEM_CATEGORY.Minor_Descri
ption, ITEM_UNIT.Item_Unit_Descri
ption, ITEM.Item_Description FROM (ITEM_CATEGORY INNER JOIN (ITEM_UNIT INNER JOIN ITEM ON ITEM_UNIT.Item_Unit_Id = ITEM.Item_Inventory_Unit) ON ITEM_CATEGORY.Category_ID = ITEM.Category) ORDER BY ITEM_CATEGORY.Account_ID, ITEM_CATEGORY.Minor_Descri
ption, ITEM.Item_Description"
I need to be able to parse the data by the 3rd column (in this case the 25) and get only the items from Category 25, build a header and display them something like this:
000.96 - COMMODITY INVENTORY (Category 25)
Item No. Unit Description
==========================
==========
====
6087 CAN APPLE SLICES, Commodity 6/#10 Cans
6088 CAN APPLESAUCE, Commodity 6/#10 Cans
6655 LBS BEAN GREEN FROZEN, Commodity 30#
204.50 - COLD BEV CAN&BOTTLE (Category 26)
==========================
==========
====
Item No. Unit Description
PEP100 CASE 12/11.5 OZ BOTTLES JUICE -DOLE
PEP101 CASE 12/15.2 OZ BOTTLES JUICE -DOLE
PEP102 CASE 24/12 OZ BOTTLE AQUAFINA WATER
This needs to continue on displaying all items under that category, etc.
Any thoughts on the best implementation for this?
Joe
Start Free Trial