Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to provide date range in calender ?

hi

i want to provide date range in calender from ist jan 2015 to 31st dec 2016

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

15 Replies
Anonymous
Not applicable
Author

Hi

1)you should  have variables loaded something like    eg : vmax / vmin (from your dates while loading )

2)And you should select the variable in the calendar object here ----"Variable(s)..

calendar.png

YoussefBelloum
Champion
Champion

Hi,

Try this:


SET v_STARTDATE = '01/01/2016';

SET v_ENDDATE = '31/12/2016';

TMP_DATE_1:

LOAD date(date#('$(v_STARTDATE)','DD/MM/YYYY')-1 + recno() ,'DD/MM/YYYY') as Date

AUTOGENERATE (date#('$(v_ENDDATE)','DD/MM/YYYY') - date#('$(v_STARTDATE)','DD/MM/YYYY')) + 1 ;

TMP_DATE_2:

LOAD

Date

RESIDENT TMP_DATE_1;

DROP TABLE TMP_DATE_1;

Anil_Babu_Samineni

Are you looking for Master calendar?

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Anonymous
Not applicable
Author

yes

Anil_Babu_Samineni

So, You have only 2 dates which are static or does they comes from Field? If it is field what it indicates

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Anonymous
Not applicable
Author

i have only two dates which are static

like 2016 and 2017

so expression for 2016 is as follows:-

=num(
sum(if(Sold_Date <= MakeDate(Prev_Year,month(To),day(To)) and Sold_Date >= MakeDate(Prev_Year,month(From),day(From)),  [inv value]))/Sales_INR_Unit,
'#,##0.0')

here prev_year is a variable which is declared as following :-


Let Prev_Year = (Year(Today())-1);


but i also want to have year comparison between 2015 and 2017 s how to do that ?


Anil_Babu_Samineni

stalwar1‌ Would you like to work with him ???

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
sunny_talwar

I have been seeing OPs thread, but I don't think I have enough information to answer him. If he can share a sample (not just expressions and variables) where we can see what he have, I might be able to look at it

Anonymous
Not applicable
Author

sir  sorry actually that i cant due to security reasons.

You just please help me if you have any idea .

if i am using

Let Prev_Year = (Year(Today())-1);

in the script (this will take system date-1=2016)(its hard coded)but i want prev_year should be declared in such a way that it can take any value less that 2017

so how to declare the variable for that?