7 Replies Latest reply: Dec 6, 2017 3:24 PM by Weston Kingsley RSS

    Grouping Codes by Prefix with Group Table

    Weston Kingsley

      Hello All,

       

      I have a list of gifts to our organization that come in with a Solicitation Code (CODE). I also have a requirement to group gifts by solicitation code using a CodeGroups Table. The issue I'm having is that the Mapping Table only uses the prefixes of the codes.

       

      Gifts

      Gift IDCode
      001USAM1205
      002USAT0023
      003USAM1109
      004AT0987
      005USBR1976
      006USBRCM
      007USAM--DD
      008USAT--09
      009USBR----
      010USAMJACKS
      011USBRG17H

       

      CodeGroups

      CodeGroup
      ATWeb
      USAMMail
      USATMissions
      USBRSpanish
      USBRCMSpanish Mission

       

      I need the result to be

      Gift IDCodeGroup

      001

      USAM1205
      Mail
      002USAT0023Missions
      003USAM1109Mail
      004AT0987Web
      005USBR1976Spanish
      006USBRCMSpanish Mission
      007USAM--DDMail
      008USAT--09Missions
      009USBR----Spanish
      010USAMJACKSMail
      011USBRG17HSpanish

       

      Any one know of a solution for something like this where the prefix length can vary?

       

      EDITED** Added gifts 007, 008, and 009

      EDIT@* Added Gifts 010 and 011