Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Calender object - Creat variable Stardate

Hello all,

How can i have Always  (if i every time start the application) a startdate with value 01-01-2016 and enddate the date of today in the underneath objects ?

Thanks in advanced!

4 Replies
Highlighted

Always means when you open the application? May be set on open trigger for those two dates when the application opens?

Highlighted
Not applicable

Hello Sunny,

Yes if i every time open the application, the startdate  in the (red markered object) must Always shown as 01-01-2016 and the Enddate (red markered object) as the date of today for example 01-05-2016.

How can i fix this problem? any code?

Highlighted
Master II
Master II

May be as attached:

Highlighted

Please find attached one way to do it with three triggers

1) Select in Field on Date

='>=' & Date(MakeDate(2016, 04, 01)) & '<=' & Date(MakeDate(2016, 04, 30))

2) Set Variable vStartDate

=Date(MakeDate(2016, 04, 01))

3) Set Variable vEndDate

=Date(MakeDate(2016, 04, 30))

Capture.PNG

Note: The set of trigger is very static and wouldn't change. Is there a more dynamic requirement to select last month? If that is the case, you can always use

1) ='>=' & Date(MonthStart(Max(Date), -1)) & '<=' & Date(MontEnd(Max(Date), -1))

2) Date(MonthStart(Max(Date), -1))

3) Date(MontEnd(Max(Date), -1))

So, in the end it all depends on what the exact requirement is

Best,

Sunny