14 Replies Latest reply: Jun 10, 2011 8:41 AM by Eduardo Correa da Silva RSS

    Month year

      Hi guys I have a small problem...

      I have year and Month No.


      If Year is 2011 and Month is 1 thn it means its April 2011.

      I want to create month year thru func.Monthname.

        • Month year
          Deepak Kurup

          hi Erika,


          Do the following  steps.


          1) go to Script -- and change the Month name format. Currently it begins with Jan;Feb;Mar;... change it to pr;Jun;Jul.....Feb;Mar;


          2) Create Date using Makedate function and use the Monthname function on it.


          MonthName(MakeDate(Year,Month)) as MonthName.



          I hope this helps.




          • Re: Month year
            Rahul Gupta

            Plz find attached app..Hope it helps..

            • Re: Month year
              Ashutosh Paliwal

              Hi Erika,

                   There are many ways to do that...Two simple ways I can suggest you are...


              1. in your environment variable settings you can use this...but be cautious this will reflect through whole document....so now your months sort order will be changed to this way and your 1st month will be april..
              • SET MonthNames = 'Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec;Jan;Feb;Mar';



              2. Another way I find will be better, is just use shift in monthname function..

              •      for example if you use monthname function like:::

                        monthname ( '2001-01-19' )  it will output Jan 2001

              • but if you use shift here and shift monthnames to 3 then ...

                        monthname ( '2001-01-19' ,3)   it will output Apr 2001


              as you only have month and year then you can use it like  monthname(makedate(Year, Month),3) it can give you your output......



              so, in 2nd one you will be having data of MonthNum 1 associated with Month Apr, that way in your front end when some one selects Apr, he will see data for MonthNum 1, and also it can be sorted on the base of MonthNum..........


              hope it helps..


              and if I did not understand your problem then, if you describe it more, like what you actually want then we may reach towards a better solution.......

              • Re: Month year



                The number 1 equals April, so add more 3 and you have the month that you want.


                Load Year, // 2011

                        (Month + 3 ) AS Month // Month = 1 = April 

                                                          // Month + 3 = 4 = April