16 Replies Latest reply: Feb 25, 2011 5:44 AM by Siva Boggarapu

# Calender Problem

Hi All,

I have created two calender in the same document. One is to select the FROM date and another one to select the TO date. But when i select FROM from the calendar by default same date has been selected in the TO date due to qlikview associative memory. I want to avoid this thing to happen.

As i am not able to select the two different date in the calendar. For example if i want to select FROM date as apr,2008 and in the TO i want to select mar,2009. This is not happening.

Let me know is whether there is any solution to avoid this issue which happening due to associative logic.

userid:0010012021,password:c2info99 to open the attached application.

• ###### AW:Calender Problem

Hi dsjain,

thats a tricky thing. First, both of your calendar boxes are pointing on the same field, so they have to show the same value. But thats not the point.

If I understand it right, you want to show the data between these two days. OK? Then you have to create two variables "vFrom" / "vTo" and use set analysis to calculate with the right values.

I don't know the right syntax but anything like sum({\$ <Date = {\$(>\$(vFrom)} , Date = {...}>}), you have to search the forum for the right use of ">" in set analysis.

Have Fun

Alex:)

• ###### AW:Calender Problem

Hello,

Having two dates properly formatted in two variables, set would look like

`Sum({< Date = {">=\$(=vFrom)<=\$(=vTo)"} >} Sales)`

• ###### AW:Calender Problem

Hi Alexander Schubert!

Thanks for your reply! We can check the syntax later on i think. First of all let me know how to create the variable. I have created the both variable as said but not sure what should be coming in the defination. I have put Date but that is not working as expected. Please help me out!

• ###### AW:Re: AW:Calender Problem

Hi,

set the variable value with a dummy value (eg. 1), then bind it to the input(calendar) boxes un your sheet and choose a value. The variable is now set properly.

Now you can test the synthax.

Have Fun

Alex:)

• ###### AW:Re: AW:Calender Problem

Hi Alexander!

I don't know how to do that. Can you please do the same in my document and attach it. It will be easier for me to understand.

• ###### AW:Re: AW:Calender Problem

Here it is. But I can't find the right synthax for the set analysis. Has anyone any suggestions?

Greetings Alex:)

• ###### AW:Re: AW:Calender Problem

Hi Alex,

You forget about the chart now. First thing i want to select the FROM and TO date values. After doing the selection rest of chart should be filtered according to this from and to value. But it is not happening. Requesting you to work on that first then we will go to the syntax part. When i select any date none of the chart is getting filtered according to the selection.

Also i want to see all the values in the from and to calendar. But as per me i think it is not showing all the months. By the way why Min(date) and Max(Date) value is used in the calendar.

Seems i have asked too much things as i am a newbie. Hope you can understand me.

• ###### AW:Re: AW:Calender Problem

Hi Alex!

Got any idea to solve my problem which i am facing? Please help me out to come of this problem.

Regards,

Rikab

• ###### AW:Re: AW:Calender Problem

Hi,

Using Alex's sample, I used the following expression and it works

Sum({<Date = {">\$(=timestamp(vFrom))<\$(=timestamp(vTo))"}>}SalValue)

The problem is that the value of the variables is coming in as numbers or dates while your Date filed is a timestamp format field. Hence it is essential to format the variables in the set analysis.

Nimish

• ###### AW:Re: AW:Calender Problem

I am attaching the example file also (the same that Alex had uploaded.

Nimish

• ###### AW:Re: AW:Calender Problem

Hi Nimish!

Thanks for your help. It may be working after using your expression but my question was as per my selection in the from and to calender it should work in rest of the charts also. Its true that it works in the given chart but how about in other charts if i don't use the expression given by you in rest of the expression? Why it doesn't work in rest of the chart same like the selection made in the list box or some other straight table. Is there is any other way to work in normal way.

• ###### AW:Re: AW:Re: AW:Calender Problem

Hi dsjain,

that is the normal way. If you want to have a selection for all the charts in your Application, you need to use a selection. Take a list Box with Months / Dates or whtever you want and select the daterange you want to see.

With the from/to-Date you dont have a selection and so you need set analysis in every expression you want to see the date range.

An other idea is to use a macro to set the selection of a listbox whenever you change the value of the variables. But I don't realy have an idea how this should be coded.

Have Fun with QV

Alex:)

• ###### Calender Problem

Hi dsjain

If i understand you correctly, you basically just want to select a range of dates, where these dates are selected in two listboxes?

If you use the set analysis formula as suggested, you need to enter this condition within all of you expressions. Another approach would to use a macro, which get the values from 2 variables (fromdate and todate) and afterwards select the dates within this range.

Attached is an example on how to do it (please disregard the weeks, periods etc - just a test for a 4-4-5 calendar which is still not finished)

/Martin

• ###### Calender Problem

Hi Martin!

Thanks for your reply. My requirement is to show the sales value in bar chart according to the selected from and to date from the calender. Please find the screen shot below and also find the attached application.

Hope it is understandable now!

• ###### Calender Problem

We are also facing same problem kindly help me

Regards

Ashish

• ###### Calender Problem

Hi Dilip,

Can u give user id for this database2.qvw.

Thanks ,

Siva