2 Replies Latest reply: May 15, 2014 10:03 AM by Steve Caiels RSS

    Wildcards

    ccribbs _

      I am trying to use a calculated field to determine if a sales account is a retail sale or a lease.  Our accounts are set up in such a way that the second to last number indicates this where 4800011 is a retail sale and 4800021 is a lease.  My thought was, since all accounts are the same length, i could use wildcards for the first 5 and last 1 digit in an if then statement.  I don't know what monarch uses as wildcards, if any.  Also, if there is a better way to accomplish this feel free to add input.

        • Wildcards
          joey

          I suggest using the left and right functions

           

          2ndFromRight = left(right(Account,2),1)

            • Wildcards
              Steve Caiels

              Hi ccribs,

               

              Monarch does have wildcards.  A ? is single character and * is multi character. 

               

              If(Account = “?????1*”,"Retail Sale,"Lease")

               

              I think Joey's expression is nice as it will always take the 2nd from the end rather than the 6th character.  But if you did specifically want the 6th character, you could either use wildcards or substr(Account,6,1).

               

              Regards,

              Steve.