We are using a GI to pull an inventory sheet and one of the columns has a name of Class for the grouping of items with specific INItemClass.ItemCLassCD such as 001-01-01, or 002-06-01. Items beginning with numbers such as 001, 002, 003, or 006 should show up as Class Items A or 010- - as ‘Other’ or 010-0- as Other. My SWITCH looks like this:
=SWITCH(LEFT(LINItemClass.ItemClassCD],3) = 001 OR LEFT(LINItemClass.ItemClassCD],3) = 002 OR LEFT(LINItemClass.ItemClassCD],3) = 003 OR LEFT(LINItemClass.ItemClassCD],3) = 006, 'Class A',
LEFT(LINItemClass.ItemClassCD],3) = 007, 'Class B',
LEFT(LINItemClass.ItemClassCD],3) = 005 OR LEFT(LINItemClass.ItemClassCD],3) = 013, 'Class C',
LEFT(LINItemClass.ItemClassCD],3) = 004 OR LEFT(LINItemClass.ItemClassCD],3) = 008, 'Class D',
LEFT(LINItemClass.ItemClassCD],3) = 012, 'Class E',
LEFT(LINItemClass.ItemClassCD],3) = 010, 'Other')
The code does pass Validation, the Class column just doesn’t show even though there are at least three pages of mixed classes. I also thought about using CStr, but in this context I’m not sure of that will work.