Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Default date on calendar object

I have a calendar object and for the data field I have the following expression:

=date(SALE_DATE, 'MM/DD/YYYY')

The dates range from 2009 to 2011.  When I click the calendar icon to bring up the date selector the selector is defaulted to Jan 2009.  I want it to default to the current month and year.  I don't want to select a date, I just want the calendar pop-up to show the current month and year when clicked.  Any ideas? Thanks. 

Here's how it looks now:

cal.JPG

10 Replies
Not applicable
Author

Moshea,

The Community Corner is for QlikCommunity-related questions; I'm moving this to the Development community.

Kindly,

Jason

Not applicable
Author

ok thanks Jason

Not applicable
Author

I believe you can let a variable in your script and then use it in your calendar. So this variable will be set each time you reload the script.

Not applicable
Author

Any update to this?

The calendar object just defaults on the lowest available date no matter what you sort on.

sibrulotte
Creator III
Creator III

Same issue,

haven't found an answer.

Just so everyone is clear: The calender is set to modify a field, hence data : Field.

By default, the calendar shows the lowest date value (like showed above, where it's at January 2009),

but we'd like it to be at today's month and year.

Thank you for the community efforts

Clever_Anjos
Employee
Employee

Check if fit your needs

jagan
Luminary Alumni
Luminary Alumni

Hi,

Create a variable

vToday = Today()

Now in Calendar object set

Max Value =YearEnd(vToday)

Min Value = YearStart(vToday, -1)

The above expressions will set the Current month as default month and year and limits the calendar for year 2013 and 2014, if you want to extend change the above expressions.

Refer attached file for solution.

Regards,

Jagan.

jaimeaguilar
Partner - Specialist II
Partner - Specialist II

Hi,

you may use a trigger (action) and a variable to set a date everytime you open a tab,

regards

sibrulotte
Creator III
Creator III

That works great for a variable. Because your setting a variable, and everyone is happy that the variable then selects a date. Great.

But I need this to be a field selection from the start to have Multi-value.

Does anyone know if that is possible?

Alternatively I could go "concat" the variables of two calendars in the trigger action to bring back an interval of dates. But that does not meet the client requirements to select multiple dates in one calendar, that are not necessarely consecutive.