Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
joantbak
New Contributor III

Set Expression Date Range Button

Hi,

I need to create a button that when when clicked will set the Date to a specified range (range is calculated by an expression)

The problem the set range is not working.

Setting date >= X works [Expression is ='<='&v.Date.Enddate]

Setting date <= X works [expression is ='>='&v.Date.Startdate]

Setting date >= X AND <= X Does NOT Work [Expression is =('>='&v.Date.Startdate&' AND <='&v.Date.Enddate)]


I am using a Button object, Action 'Select in Field'

1 Solution

Accepted Solutions
MVP
MVP

Re: Set Expression Date Range Button

'AND' operator might not be required, try without that and proper quotes, may be like:

='(<='&v.Date.MAT.Enddate & ' >='&v.Date.MAT.Startdate&')'

6 Replies

Re: Set Expression Date Range Button

try this


='>=$(=v.Date.Startdate) <=$(=v.Date.Enddate)'

Re: Set Expression Date Range Button

or

='>='& $(=v.Date.Startdate) & '<=' & $(=v.Date.Enddate)

joantbak
New Contributor III

Re: Set Expression Date Range Button

Hi Kushal,

Thanks for your suggestion unfortunately neither return any results.

using =('>='&v.Date.Startdate&' AND <='&v.Date.Enddate) the end date of 31/07/2017 does seem to get applied but no the start date, If I switch the dates around so the expression is =('<='&v.Date.MAT.Enddate&' AND >='&v.Date.MAT.Startdate) then the Start date of 01/08/2016 is applied but not the end date.

It's like it's only applying the expression part after the AND..?!?

Re: Set Expression Date Range Button

Would you be able to share the sample?

MVP
MVP

Re: Set Expression Date Range Button

'AND' operator might not be required, try without that and proper quotes, may be like:

='(<='&v.Date.MAT.Enddate & ' >='&v.Date.MAT.Startdate&')'

joantbak
New Contributor III

Re: Set Expression Date Range Button

Many thanks Tresesco your solution is correct