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)
First day of previous month as paramter
martinf
<p>Hi</p>
<p> </p>
<p>I'm trying to have the first day of the previous month by default parameter.</p>
<p>If I run my report today, my parameter will be 2016-12-01.</p>
<p>Idea?</p>
<p> </p>
<p>Martin</p>
Find more posts tagged with
Comments
shamo
<p>In the default window type BirDateTime.addMonth(BirtDateTime.firstDayofMonth(BirtDateTime.Tody()),-1) hope it works</p>
martinf
<p>Thank you Shamo but it doesn't work.</p>
<p>Il already tried that.</p>
<p> </p>
<p>Martin</p>
shamo
<p>Can you explain what you want to do? You may have to get two date parameters with the start date being the default date and the the end date being the day you want it ended. If just using the start date, you will only get results for actions that ocured just on the first date.</p>
Matthew L.
<p>Depending on what version of BIRT you are using, the call <a data-ipb='nomediaparse' href='
http://help.eclipse.org/kepler/topic/org.eclipse.birt.doc/birt/ScriptingReference.24.4.html?cp=8_0_23_2'>BirtDateTime.firstDayOfMonth</a>
; might not have been implemented yet.</p>
<p> </p>
<p>Here is an example that will work with older versions of BIRT (Also see attached example):</p>
<pre class="_prettyXprint _lang-js">
var d = 1;
var MM = BirtDateTime.month(BirtDateTime.today())
var yyyy = BirtDateTime.year(BirtDateTime.today())
var dt = yyyy + "-" + MM + "-" + d;
BirtDateTime.addMonth(dt,-1)
</pre>
martinf
<p>Hi</p>
<p> </p>
<p>I'm trying to have, by default, the first day of the previous month (from current date) as parameter.</p>
<p><a data-ipb='nomediaparse' href='
https://dl.dropboxusercontent.com/u/22288628/default_parameter.png'>https://dl.dropboxusercontent.com/u/22288628/default_parameter.png</a></p>
;
<p>BIRT 4.5</p>
<p> </p>
<p>Thank you</p>
<p> </p>
<p>Martin</p>