3 Replies Latest reply on Mar 3, 2009 2:56 PM by raybaudi

    Help with Case calculation

    Thicks

      Title

      Help with Case calculation

      Post

      Here is the calculation that I have written for when a position number lands betwwen a certain range that it calculates the department.

       

      Case ( Position#Second3Digits= 001...099; "Administration";
      Position#Second3Digits= 100...289; "Project Development/Planning";
       Position#Second3Digits= 300...349; "Engineering Services";
       Position#Second3Digits= 400...499; "Right of Way";
       Position#Second3Digits= 500...599; "Construction";
       Position#Second3Digits= 600...799; "Maintenance"; Other)

       

      However it tells me that I cannot use 001...099

       

      How can I make it for the range of numbers I have shown?

       

      Thanks



        • 1. Re: Help with Case calculation
          raybaudi
            

          Let (

          p = GetAsNumber ( Position#Second3Digits ) ;

          Case( 
          p < 100 ; "Administration";
          p < 300 ; "Project Development/Planning";
          p < 400 ; "Engineering Services";
          p < 500 ; "Right of Way";
          p < 600 ; "Construction";
          p < 800 ; "Maintenance";
          Other )

          )




          • 2. Re: Help with Case calculation
            Thicks
              

            Raybaudi

            Thank you for all of your help I truely appreciate it.

             

            Question what if I wanted to leave my employees position number as one 10 digit instead of how I have broken it up into pieces.

             

            Could I use the calculation you have given me for this

             

            EX: 9130885171002 (employee position number)

             

            since the 2nd 3 numbers = 088

             

            then my calculated result would be "Administration"

             

             

             

             

            • 3. Re: Help with Case calculation
              raybaudi
                

              Yes.

               

               

              Let (

              p = GetAsNumber ( Middle ( Employee position number ; 4 ; 3 ) ) ;

              Case(
              p < 100 ; "Administration";
              p < 300 ; "Project Development/Planning";
              p < 400 ; "Engineering Services";
              p < 500 ; "Right of Way";
              p < 600 ; "Construction";
              p < 800 ; "Maintenance";
              Other )

              )