Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Like many, I need often to find whether a date value falls within a date range. For example, in a chart expression.
I have tried to find a function for this eg. InDateRange(date_value,from_date, to_date) but cannot find one.
Of course, I can use nested IFs but was hoping there is a function to make it neater.
Any ideas?
Thanks
Intervalmatch may be you're looking for. But it's only available in the load script. Otherwise you're indeed limited to and if statement like if(Mydate >= StartDate and Mydate <= EndDate, 1,0)
Hi
Thanks for your very fast response !
My understanding is that IntervalMatch is a scripting function (to filter the data loaded).
I want to load 3 year's worth of data (say) and let the user enter start and end dates on the information they wish to view in a chart.
Hi
you have to use the set analysis expression for the date field
for exm
sum({$<Date = {">=$(vStartDate)<=$(vEndDate)"}>} SalesValue)
here vstartdate and venddate are variables
it gives the values for this range only
Intervalmatch is a scripting function, but not to filter out data, but to match it with intervals. Often this is used to match a date with a period. But it can also be used for other intervals.
I've attached a qvw file with an example using input boxes to enable users to select an interval and show the relevant data. I hope this helps you.
Thanks for your help
Hi - that's helpful, thanks.