Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

How to get the Calendar with Only Year and Month?

Hi,

Currently I have data in the following ways:

Material     Month          Order#

M01          2012-01        540     

M01          2012-02        560          

M01          2012-03        640       

M01          2012-04        580       

M01          2012-05        510

M02          2012-01        340     

M02          2012-02        360          

M02          2012-03        140       

M02          2012-04        580       

M02          2012-05        810  

I want to creat a bar chart with Month Range Selection.

I noticed that this could be done by Slide or Calendar, however, i wonder how i can create a Calendar without date?

Could anyone please help?

Thanks in advance

Jerry

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: How to get the Calendar with Only Year and Month?

Hi

In this sort of situation, useFor your dimension for your dimension:

     Date(MonthStart(Date#(Month, 'YYYY-MM')), 'YYYY-MM')

Now it does not matter which day in the month you select.

If you really dont like the calendat object which will not allow you to select a month only, create month and year list boxes

     Month(Date#(Month, 'YYYY-MM'))

     Year(Date#(Month, 'YYYY-MM'))

(These will work in the front end, but for performance, all these transforms are best done in your script)

Hope that helps.

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
9 Replies
Not applicable

Re: How to get the Calendar with Only Year and Month?

you can do it on many ways, for example paste this expression as a dimension

=makedate(left(Month,4),right(Month,2),1)

Not applicable

Re: How to get the Calendar with Only Year and Month?

Hi Pari,

Thanks for your reply.

But the new dimension, the data will be transfromed into YYYY-MM-01, is there any solution to ignore 01 in the Calendar?

for example, to set up a Calendar like:

    2012

Jan  Feb Mar Apr

May Jun Jul   Aug

Sep Oct Nov Dec

Regards

Jerry

MVP
MVP

Re: How to get the Calendar with Only Year and Month?

Hi

In this sort of situation, useFor your dimension for your dimension:

     Date(MonthStart(Date#(Month, 'YYYY-MM')), 'YYYY-MM')

Now it does not matter which day in the month you select.

If you really dont like the calendat object which will not allow you to select a month only, create month and year list boxes

     Month(Date#(Month, 'YYYY-MM'))

     Year(Date#(Month, 'YYYY-MM'))

(These will work in the front end, but for performance, all these transforms are best done in your script)

Hope that helps.

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

Re: How to get the Calendar with Only Year and Month?

=monthname(makedate(left(Month,4),right(Month,2),1))

Not applicable

Re: How to get the Calendar with Only Year and Month?

yeah, this looks more proffesionalSmiley Happy)

Not applicable

Re: How to get the Calendar with Only Year and Month?

Hi Jonathan,

It is cool!

but i have another question regarding to this solution, how can i create a value range based on that one?

with the list box, i can only choose the specified month for my chart, do you have any ideas?

Regards

jerry

Not applicable

Re: How to get the Calendar with Only Year and Month?

Hi Pari,

If i creat a Calendar object with this variable, the value can not be displayed, do you have any ideas?

Regards

Jerry

MVP
MVP

Re: How to get the Calendar with Only Year and Month?

Jerry

That is a different question. For the best response, I would suggest that you create a new post.

In the post, provide details of the ranges you want (eg MTD based on the selected month/year, YTD, prior MTD, prior YTD etc etc).

There are many ways of dong this and the best way will depend on your model's data structure, the user requirements etc etc. The more information you provide, the better. If possible, post your model or a representative sample when you create the new post.

BTW if the original question has been answered, please mark the correct answer.

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

Re: How to get the Calendar with Only Year and Month?

Hi Jonathan,

Thanks for your help, I will make a new post.

Regards

Jerry

Community Browser