1 Reply Latest reply on Jul 20, 2011 10:12 AM by philmodjunk

    Script to look for different Numbers....

    ArminWittmannCabrera

      Title

      Script to look for different Numbers....

      Post

      Hello,

      Im new in the business and have a question.

      i have a excel sheet that i import in a database. This contains a field called "Tarifs" and is defined as a Numberfield.

      Now i want transfer this in a text field that contains a text. e.x. 1111 = Basis (this can i do with the "IF" function)

      But i have different Tarif-codes that will get the text "Basis".

      How can i check the tarif-field for all my numers and told my new field to show the defined text?

      e.x. 1111, 1112, 20001 = "Basis"    -   3001, 3002, 3003 = "Standard"

      Many thanks for your help.

      Arminius

        • 1. Re: Script to look for different Numbers....
          philmodjunk

          Case ( Tarif = 1111 or Tarif = 1112 or Tarif = 2001 ; "Basis" ;
                    Tarif = 3001 or Tarif = 3002 or Tarif = 3003 ; "Standard" ;
                    "Error" )

          This returns the specified text for the specified codes and returns "Error" if tarif does not match any of these values.

          You could also set up a table of Tarif Codes, with the basis text entered into a field in this table. Then, if you establish a relationship based on the tarif code fields in these two tables, you can put the Basis field from the related field on your layout or refer to this field (via the relationship) in calculations.

          This second approach is more work to set up, but allows you to modify the text and associated tarif codes by editing the records in this related table instead of having to update your calculation each time a change needs to be made.