Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

showing Month + Year in a chart

I have created a timedrill, but I want to know how to limit the Timedrill, so you have to choose Year before month etc.

Skærmbillede 2012-07-05 kl. 11.16.12.png

Also I woundering how to display Month + Year with a chart, when using a Timedrill - because now my charts sums numbers fra May of both 2011 and 2012, if I dont choose a year?

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hm,

Try:

     Dual(Month(Created) & ' ' & Year(Created),year(Created) & num(month(Created), '00')) as YearMonth

This should create a YearMonth value that looks like this: Jun 2011

But has an underlying value of 201111 which should help when sorting the dimension numerically so Apr 2011 doesn't come before Jun 2011 for example.

View solution in original post

7 Replies
Anonymous
Not applicable
Author

You could add a calculation condition to the chart to only calculate if a single year is selected?

if(Count(Year)=1,1,0)

Or perhaps use set analysis to calculate the chart for the maximum selected year?

Or create a drill down group where you show the chart by year and then when a user clicks on a year it drills down to the month level?

Not applicable
Author

What I would like is just that eacj bar group has "Jun 2011" instead of just "Jun"

Anonymous
Not applicable
Author

Oh, ok.

Nicest approach would be to define a MonthYear field in your calendar in the script and use that as the dimension.

Not applicable
Author

I apologize, but I'm a newbie at qlikview 🙂

I am not able to define a MonthYear in the script?

Skærmbillede 2012-07-05 kl. 11.40.19.png

Are I'm in the right place?

Anonymous
Not applicable
Author

Hm,

Try:

     Dual(Month(Created) & ' ' & Year(Created),year(Created) & num(month(Created), '00')) as YearMonth

This should create a YearMonth value that looks like this: Jun 2011

But has an underlying value of 201111 which should help when sorting the dimension numerically so Apr 2011 doesn't come before Jun 2011 for example.

Not applicable
Author

WoW thanks man!

Help me a lot 🙂

Should I add the YearMonth to the timedrill?

Anonymous
Not applicable
Author

Yes, try replacing the dimension with YearMonth. However, now you will have X * 12 dimension values instead of 12 (X of course being the number of years you have data for).