Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Ruthie09
New Contributor II

Need formula for Date Picker custom ranges

I have been researching this for a couple of hours now and can't seem to find an answer.

I am using the VizLib Calendar extension (date picker) and the date ranges offered don't meet my needs.  If, for example, I wanted the last 3 months of data, what I would get using the built in options would pull a rolling 3-month period.

However, what I'm looking for is a formula that would capture the last 3 months since the 1st of that month.  For example, today Sept 11.  I need a formula that would grab all dates since June 1st.

Anyone have any ideas?

5 Replies
Partner
Partner

Re: Need formula for Date Picker custom ranges

Hi Ruthie, 

You can quickly add custom date ranges to the Vizlib Calendar. The steps are detailed here: https://community.vizlib.com/support/solutions/articles/35000131319-vizlib-calendar-data-ranges

Ruthie09
New Contributor II

Re: Need formula for Date Picker custom ranges

I am familiar with those but as I mentioned, when I configure it for the last 3 months, I get a rolling three months (meaning I would get since June 11).  What I need is the 1st of that month.

Partner
Partner

Re: Need formula for Date Picker custom ranges

Right - you can use the expression editor and the function MonthStart() for this purpose: https://help.qlik.com/en-US/sense/June2019/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeFun...

Ruthie09
New Contributor II

Re: Need formula for Date Picker custom ranges

I must be doing something wrong because this doesn't work:
=MonthStart(Today(),-3)
which I think is what that doc says.

Re: Need formula for Date Picker custom ranges

Hey Ruth,

 

sounds like you need this:

 

monthstart(  addmonths( [MyDate], -3)  )