Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Date parameter result to be previous year
Tinwolf
<p>I have a a couple of very simple parameters setup (`cos simple is all I know how to do) which return a start date and an end date.</p>
<p>How can I use the dates entered to return values which are the same dates from the previous year?</p>
<p>So I`d want to be able to enter 01/01/17 and 31/05/17 to get this year`s data but I would also want to see the data from the previous year without entering 2 new dates.</p>
<p> </p>
<p>and invoice.taxdate >= ?<br>
and invoice.taxdate <= ?</p>
Find more posts tagged with
Comments
Matthew L.
<p>To keep things simple, you can create additional parameters that are hidden with the following code in them to calculate 1 year in the past from the 'StartDate' (and 'EndDate') input parameters.</p>
<p> </p>
<p>Use this code to calculate 1 year in the past from the input date:</p>
<p>BirtDateTime.addYear(params["StartDate"].value,-1);</p>
<p> </p>
<p>See attached example</p>