2 Replies Latest reply on Oct 3, 2011 10:23 AM by user15130

    Case Function

    user15130

      Title

      Case Function

      Post

      Within my solution I also have a month and year field, say January and 2011.

      If I wanted another calc field to say if the month falls in a specific quarter say "Quarter 1" what would the case function be?

       

      I had:

       

      Case (Field = "January" ; Field::Quarter 1 )

      But the next 11 months? and also it does not work as I am writing it.

      Marty

      Screen_shot_2011-10-03_at_9.20.53_AM.png

        • 1. Re: Case Function
          philmodjunk

          I'd use an actual date field for this instead of two fields for month and year, but working with that month field and assuming that it is of type text, not number:

          Ceiling ( Ceiling ( Position ( "JanFebMarAprMayJunJulAugSepOctNovDec" ; Left ( Yourtable::MonthNameField ) / 3 ) / 4 ) will return 1 for the first quarter, 2 for the second, and so forth -- which should greatly simplify your case function here.

          • 2. Re: Case Function
            user15130

            Thank you.   I will try this tonight when I get the original file back. 

             

            Marty