Hi All,
I have inherierted a field that has a rather extensive @if formula that I would like to shorten or redo, to help with the maintenance of a database.
Currently the formula looks at a part number then determines how to categorize it in a view. New categories are created a few times a year and I would like to have a way that will help simplify this formula or ideally make it so that I can allow a non-designer to update a form? to update the field.
I know how to seperate the info into two fields on a form to get both pieces I need I just don’t know what direction I would take after that. Any help, pointers, even can’t be done, would be most appreciative. Unfortunately it is not just looking at the first three or first four characters, then it would be easy.
Here is the code as it exists now.
w := @Left(Num; 4);
x := @Left(Num; 3);
y:=@Left(num;1);
z:=@Left(num;2);
@If(w=“9161”;w + " – Computer Accessories/Parts/Resale Items";
w=“9162”;w + " – Cabinets/Enclosures";
w=“9163”;w + " – MFG Specified Assemblies";
w=“070S”|w=“070P” & w!=“070-”;w+" – Stencils (See 070 for PCBs)";
w=“LADG”|w=“LADG”;w+" – Application Design Guides";
w=“LPSS”|w=“LPSS”;w+" – Flyer ,Power Systems Solution";
w=“UPUB”|w=“UPUB”;w+" – Literature";
y=“P”; @If(x=“PDS”;x+ " – Product Data Sheet";@If(x=“PGS”; x+ " – Guideform Spec"; @If(x=“PLS”; x+ " – Product Literature Instruction Sheet"; @If(x=“PSK”; x+ " – Product Sales Kit";@If(x=“PSB”; x+ " – Product Service Bulliten";@If(z=“PF”; z+ " – Product Flyer";@If(z=“PM”; z+ " – Product Manuals";y+ " – PCB Assembly Components")))))));
y=“C”;@If(z!=“CD”;y+" – Cables";z+ " – CDs");
x=“A70”;x + " – PCB Assembly Drawing";
z=“EG”;z+" – Label Artwork";
z=“EO”;z+" – EOS Products";
z=“ET”;z+" – Overlay Tooling";
z=“EP”;z+" – SEL OEM Plastic Parts";
x = “LAN”; x + " – Literature Application Notes";
x = “LCS”; x + " – Literature Case Studies";
x = “LDG”; x + " – QuickSet Design Template Guide";
x = “LWP”; x + " – Literature White Papers";
x = “LIT”; x + " – Books";
x=“LTE”;x+ " – Employee Development Training Materials";
x=“UCD”;x + " – CDs";
x=“UPM”;x + " – Printed Literature File";
z = “LM”;z+" – Literature Miscellaneous";
z = “LP”;z+" – Literature - Paper & Misc. Docs";
z= “LC”;z+ " – Literature Collections";
y = “L”; y+" – Licences";
y=“S”;@If(w=“SELU”;w+ " – SEL University Literature “; @If(x=“S70”; x+ " – Schematics”;@If(x=“SEM”; x+ " – Seminar Books";y+ " – S-Subs")));
z=“AG”;z+" – Application Guides";
z=“TP”;z+" – Technical Papers";
@If(x = “000”;x+" – New Parts";
x = “010”; x + " – ABB Stuff";
x = “015”; x + " – Batteries";
x = “020”; x + " – Bus Strip";
x = “030”; x + " – Cable, Raw";
x = “031”; x + " – Cable, Fiber Optic, Raw";
x = “040”; x + " – Capacitors";
x = “041”; x + " – Capacitors, SMT";
x = “042”; x + " – Capacitors, Array, SMT";
x = “050”; x + " – Card (Rector Board)";
x = “060”; x + " – Case/Cabinet Assemblies";
x = “065”; x + " – Choke/Inductor";
x = “066”; x + " – Choke/Inductor, SMT";
x = “070”; x + " – PCB Fabrication";
x = “F70”; x + " – Printed Circuit Board";
x = “M70”; x + " – Mech Board Outlines (R&D Process Document Only, Do NOT use for Production)";
x = “080”; x + " – Cable Clamps & Ties";
x = “090”; x + " – Connectors";
x = “095”; x + " – Crystals";
x = “099”; x + " – Fiber Optic Components";
x = “100”; x + " – Diodes/TVS";
x = “101”; x + " – Diodes, SMT";
x = “110”; x + " – (Moved Ejector to 144)";
x = “112”; x + " – (Moved Feet to 144)";
x = “115”; x + " – Displays, LCD, Etc.";
x = “120”; x + " – Fuse, Fuse Holder";
x = “130”; x + " – (Moved Grommet to 144)";
x = “135”; x + " – (Moved Handle to 144)";
x = “140”; x + " – Screw, Bolt (Move Nut - 141, Washer - 142, Fasteners - 143) ";
x = “141”; x + " – Nuts";
x = “142”; x + " – Washers";
x = “143”; x + " – Fasteners, Misc. (standoffs, spacers, clips, rivets, jack screws, etc.)";
x = “144”; x + " – Hardware, Misc. (hinges, knobs, ejectors, latches, handles, grommets, feet, pins, plugs)";
x = “145”; x + " – Heat Sink";
x = “150”; x + " – Integrated Circuit (IC)";
x = “151”; x + " – Integrated Circuit (IC), SMT";
x = “152”; x + " – Integrated Circuit (IC), SMT Programmed";
x = “155”; x + " – Plastic, Sheet Laminate";
x = “156”; x + " – Custom Molded Plastic Parts";
x = “157”; x + " – Label Sets";
x = “158”; x + " – (Moved Laminate to 155)";
x = “159”; x + " – Label Assemblies";
x = “160”; x + " – Lamp";
x = “165”; x + " – Adhesive, Potting Compound";
x = “170”; x + " – Magnetic Core, Ferrites";
x = “180”; x + " – Marker Wire";
x = “190”; x + " – Metal, Sheet Chassis Parts";
x = “191”; x + " – Metal, Other Chassis Parts";
x = “195”; x + " – Overlays, Up to 200 Series";
x = “196”; x + " – Overlays, 300 Series";
x = “197”; x + " – Overlays, Communication Products";
x = “198”; x + " – Overlays, 500 Series";
x = “199”; x + " – Overlays, 99XX Series (Labels, Disk - Move to 157)";
x = “200”; x + " – MOV";
x = “205”; x + " – Oscillator";
x = “210”; x + " – ( Moved Pin → 144, Plug → 144, POT → 260, and Jack → 090)";
x = “212”; x + " – Power Entry Modules";
x = “215”; x + " – Key Pad";
x = “220”; x + " – (Moved Switch to 290)";
x = “230”; x + " – Power Supply";
x = “235”; x + " – RF Devices (Antenna, Coax Cable, etc.)";
x = “240”; x + " – Resale Products";
x = “248”; x + " – R-Pack, SMT, Precision (ex: 0.5%)";
x = “249”; x + " – R-Pack, SMT";
x = “250”; x + " – Relays";
x = “251”; x + " – Resistors, SMT, 1W or Greater (2010 Pkg., Etc.)";
x = “252”; x + " – Resistors, SMT, 1/16W, 1%, 0603";
x = “253”; x + " – Resistors, SMT, 1/16W, 1%, 0402";
x = “254”; x + " – Resistors, SMT, Precision (ex: 0.5%)";
x = “255”; x + " – Resistors, SMT, 1/8W, 1 & 5%";
x = “256”; x + " – Resistors, SMT, 1/4W, 1 & 5%";
x = “257”; x + " – Resistors, 1W, 1%, MEG OHM";
x = “258”; x + " – Resistors, Carbon/Ceramic Comp. 2W, 5%";
x = “259”; x + " – Resistors, 1/4W, 0.25%";
x = “260”; x + " – Resistors, Misc./POTS";
x = “261”; x + " – Resistors, MF, 1/4W, 2%";
x = “262”; x + " – Resistors, MF, 1/4W, 1%";
x = “263”; x + " – Resistors, WW";
x = “264”; x + " – Resistors, MF, 1/2W, 1%";
x = “265”; x + " – Resistors, Metal Oxide, 5%";
x = “266”; x + " – Resistors, Metal Glaze, 5%";
x = “267”; x + " – Resistors, Undefined";
x = “268”; x + " – Resistors, 1/4W, Precision (ex: 0.5%)";
x = “269”; x + " – Resistors, 1W";
x = “270”; x + " – Sockets";
x = “271”; x + " – Resist, WW, >1%, Multiple Wattages, Flame Proof";
x = “272”; x + " – Resistors, 1/16W, 1%, 0805";
x = “280”; x + " – Mfg Supplies (ex: Solder, Flux, etc.) (Moved Others to 143)";
x = “285”; x + " – Misc Electronic Components (Speakers, etc.)";
x = “290”; x + " – Switch";
x = “293”; x + " – Tape";
x = “300”; x + " – Terminal Block, Terminals";
x = “305”; x + " – Thyristor, Triac, Diac";
x = “310”; x + " – (Moved Tie to 080)";
x = “315”; x + " – Thermistor";
x = “320”; x + " – Transformer";
x = “325”; x + " – Transistor";
x = “326”; x + " – Transistor, SMT";
x = “330”; x + " – Tubing (Move Edge Protect to 144)";
x = “340”; x + " – (Moved washer to 142)";
x = “350”; x + " – Wire";
x = “360”; x + " – Raw Materials (Metal, Plastic, Etc.)";
x = “370”; x + " – Packaging Material (Moved Tape - 293, Labels - 157)";
x = “380”; x + " – Printed Materials Other Than Manuals";
x = “385”; x + " – Marcom Purchased Products";
x = “900”; x + " – Computer Accessories by CSD/SSD";
x = “910”; x + " – Defined by SSD";
x = “920”; x + " – Non-SEL Qualified Customer Specified Parts";
x = “930”; x + " – Customer Specified Pass-Through Parts";
x = “950”; x + " – Operating Systems";
x = “999”; x + " – Components for Contract Manufacturing";
x = “F70”; x + " – PCB Fabrication";
x = “LIT”; x + " – Books";
x = “NFP”; x + " – Not for Production";
x + " – No Category Defined"))
Thanks in advance,
Teri