Skip to main content
Announcements
Intermittent issues logging into the Qlik Community. We are working toward a resolution.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calendar object Start and End Date to default/select to Saturday of that week.

Hi All,

I'm working with calendar object to have the range selected via Start Date and End Date. Everything works fine when any day with the master calendar 'Date' field has been selected.

I need help in resolving the issue to point the day point to default and show the weekend date (Saturday of the week).

What I'm looking for is when any day is selected then it needs to show/default to the WeekendDate (Saturady of that week) for the Start Date and End Date calendar objects.

Not sure if any one came across this scenario as I need your help and your expertise to solve this critical issue. I'm having hard time resolving myself.

Any help with this would be very helpful.

Thanks,

DD

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Sorry, I'm confused now.  If you select 02/19/2014 in the Start Date, this it what it shows, not the 2/22/2014.  I added a text boxes under calendars to show the respective weekends.

Or, do you want the calendar objects to ignore user selection and switch to the weekend dates instead?  It is possible too, I'm just not sure if this is what you want, because this behavior may look wrong for user (?)

If you really want this, add action to vStartDate variable, on input:
Exteranal - Set Variable - vStartDate - Value =floor(weekend(vStartDate,0,-1))

And, similar for the vEndDate

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Dipti,

I'm not quite sure what the problem is, but can help with finding the Saturdays.  If the field name is Date, and you select one value there, the Saturday will be

=date(weekend(Date)-1)

or

=weekend(Date,0,-1)

Regards,

Michael

Not applicable
Author

Hi Michael,

Thanks for the quick response.

I'm attaching the sample qliview application that I'm working on, if you could please help me modifying the application to default the calendar StartDate and EndDate to show/default to WeekEndDate of that week to any selection made that would be very helpful.

For Example, I have picked Feb 19 2014 The StartDate Calendar Object to show/default/highlight selected value to Feb 22 2014, same way I picked Feb 26th End Date, the EndDate Calendar object should to show/default/highlight to Mar 1st of that week.

Any help is greatly appreciated, thanks in advance.

Thanks,

DD

Anonymous
Not applicable
Author

Sorry, I'm confused now.  If you select 02/19/2014 in the Start Date, this it what it shows, not the 2/22/2014.  I added a text boxes under calendars to show the respective weekends.

Or, do you want the calendar objects to ignore user selection and switch to the weekend dates instead?  It is possible too, I'm just not sure if this is what you want, because this behavior may look wrong for user (?)

If you really want this, add action to vStartDate variable, on input:
Exteranal - Set Variable - vStartDate - Value =floor(weekend(vStartDate,0,-1))

And, similar for the vEndDate

Not applicable
Author

Thanks Michael, it worked added an additional trigger to show the calendar objects to ignore user selection and switch to the weekend dates instead, thats what the user wanted.

Upon adding additional triggers to variables as instructed by you it worked.

Many thanks for helping resolve the issue.

Thanks,

DD