Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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.

14 Replies
Not applicable
Author

I can't attch my app...its too heavy...

in small dataset u won't be able to understand the thing....

neither can i prepare a dummy data....it will take a lot of Time...

Not applicable
Author

Here I have a calendar which has some fiscal fields maybe you can use. I use the addmonths function, and also a sort of load order, using the table at the top which is later concatenated into the main calendar table

How do i add a file - I can't find the option !

ok got it!

deepakk
Partner - Specialist III
Partner - Specialist III

hi Erika,

Try this for converting textb APR into num.

date(Date#('APR','MMM'),'MM')

Deepak

Not applicable
Author

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.......

Not applicable
Author

Hi,

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

...