Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm using the Date Picker object to allow the user to select what range of sales data they want to look at.
I'd also like to have a comparison to a previous time period. I.e if they select last 30 days it would show whether we're up or down vs the last 60 days.
My question is how can I get the value of the entered date range?
Many Thanks
Ben
i beliave it doesnt really matter how the dates are selected (using a list or other objects). final outcome is a list of values are selected. have you tried the simpler expressions to get the range? i would save these in variables so you can compute the comparison dates
vLowRange=date(min(YOURDATEFIELD))
vHighRange=date(max(YOURDATEFIELD))
vLowCompare=date(vLowRange-30)
vHighCompare=date(vHighRange-30)
and then you can use these dates in your set analysis: {<YOURDATEFIELD={">=$(vLowRange)<=$(vHighRange)"}>} for the current period; {<YOURDATEFIELD={">=$(vLowCompare)<=$(vHighCompare)"}>}
obviously, these dates will not align on same line (9/1/2020 will not align with 10/1/2020). to make them align you need some scripting and of course depending on the requirements