Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

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
Highlighted
Creator II
Creator II

Re: how to provide date range in calender ?

15 Replies
Highlighted
Specialist
Specialist

Re: how to provide date range in calender ?

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

Highlighted
Champion
Champion

Re: how to provide date range in calender ?

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;

Highlighted

Re: how to provide date range in calender ?

Are you looking for Master calendar?

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)
Highlighted
Creator II
Creator II

Re: how to provide date range in calender ?

yes

Highlighted

Re: how to provide date range in calender ?

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

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)
Highlighted
Creator II
Creator II

Re: how to provide date range in calender ?

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 ?


Highlighted

Re: how to provide date range in calender ?

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

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)
Highlighted

Re: how to provide date range in calender ?

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

Highlighted
Creator II
Creator II

Re: how to provide date range in calender ?

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?