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

    Case Function



      Case Function


      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.



        • 1. Re: Case Function

          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

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