troutstudio Posted October 9, 2010 Posted October 9, 2010 I am new to scripting; so I am asking for help with this to allow me to study the logic and try to understand it. I have records in a field "course". These have been imported from an SQL database and has resulted in values from 1-5 in this field. I want to create another field in which these values are interpreted and displayed as "First Year 310"; Second Year 412" etc. What's the easiest way to do this? Case? A value list? I have been trying but not getting too far. Thanks very much for your time. pk
Lee Smith Posted October 10, 2010 Posted October 10, 2010 Hi PK, This Choose statement seems to do what you are asking. Your new field Calculation (Text Result) = Choose ( Course ; 12345; "First Year 310"; "Second Year 412"; "Third Year 514"; "Fourth Year 616"; "Fifth Year 718") HTH Lee
Raybaudi Posted October 10, 2010 Posted October 10, 2010 Another calulation based on Choose ( ) Let([ r = Choose ( Course ; "" ; "First" ; "Second" ; "Third" ; "Fourth" ; "Fifth" ) ; t = If ( not IsEmpty ( r ) ; " Year " & Course * 102 + 208 ) ]; r & t )
troutstudio Posted October 26, 2010 Author Posted October 26, 2010 (edited) Thanks for both contributions. They both worked very well. Since they perform slightly different functions, I got a 2 for 1 deal! ;-) Much appreciated. Edited October 26, 2010 by Guest
Recommended Posts
This topic is 5143 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now