Lookup Table Help

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Lookup Table Help

  • Creator
    Topic
  • #49294
    Jack Plumb
    Participant

      I have values 1,2,3,4,5,6,7,8,9 that I need to translate into 01, 02, 03, etc. When I put the table in the xlate the values 1-9 work fine. However, 10 and above, or anything else not in the table doesn’t cross over.

      How do I configure the table and/or xlate to send everything else “as is”?

      Thanks,

      Jack

    Viewing 2 reply threads
    • Author
      Replies
      • #61407
        Charlie Bursell
        Participant

          Unfortunately you don’t.  It is an enhancement we have been asking for.  You can get the lookup value or the default that is all.

          There are two alternatives, both involving Tcl snippits

          Assume your table returns 0 if not found

          set inpVal [lindex $xlateInVals 0]

          set outVal [tbllookup tblname $inpVal]

          if {!$outVal} {set outVal $inVal}

          set xlateOutVals

            But a far simplier solution for you would be not to use a table at all;

            set xlateOutVals

              ]]

              Should be the only statement you need.

          • #61408
            Jim Kosloskey
            Participant

              Jack,

              I think I have done this another way.

              Set the Table lookup with a default of ‘N’ or 99 (something that cannot be in the inbound or the Table).

              Do the lookup in the Xlate.

              Then do an IF Action checking the OUTBOUND filed to see if it is the default (N or 99 or whatever you have set as the default).

              If the above is true (the outbound field is equal to the default) then COPY the inbound to the outbound thereby replacing the default from the Table Lookup with the inbound field.

              Many different ways to do this but it should would be nice to finally have the many requested enhancements to Table Looku.

              Thanks,

              Jim Kosloskey

              email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

            • #61409
              Jack Plumb
              Participant

                Charlie/Jim,

                Thanks for the response. We ended up using Charlie’s suggestion.

                I did not have an oppportunity to test Jim’s theory but will do that tomorrow.

                Thanks again,

                Jack

            Viewing 2 reply threads
            • The forum ‘Cloverleaf’ is closed to new topics and replies.