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)
Fetching No Of Days In a Month
BUBU
Sir In a comapany ter z 30 employee and i need to show tha avreage attendance percentage rate of all the employee in a barchat.so my question z that can we findout each month's date in birt.suppose jan have 31 days nd feb have 28 days like wise
Find more posts tagged with
Comments
BUBU
Sir In a comapany ter z 30 employee and i need to show tha avreage attendance percentage rate of all the employee in a barchat.so my question z that can we findout each month's date in birt.suppose jan have 31 days nd feb have 28 days like wise
mwilliams
One simple thing you could do would be to create an array or variables in your initialize script that defines the number of days in each month. Or you could just do this in your computed column script. The only issue here becomes leap years, but you could handle that in your script as well by checking the year.
BUBU
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="82720" data-time="1316007000" data-date="14 September 2011 - 06:30 AM"><p>
One simple thing you could do would be to create an array or variables in your initialize script that defines the number of days in each month. Or you could just do this in your computed column script. The only issue here becomes leap years, but you could handle that in your script as well by checking the year.<br /></p></blockquote>
so how can be done by computed column script?
BUBU
<blockquote class='ipsBlockquote' data-author="'BUBU'" data-cid="82722" data-time="1316007437" data-date="14 September 2011 - 06:37 AM"><p>
so how can be done by computed column script?<br /></p></blockquote>
BUBU
<blockquote class='ipsBlockquote' data-author="'BUBU'" data-cid="82722" data-time="1316007437" data-date="14 September 2011 - 06:37 AM"><p>
so how can be done by computed column script?<br /></p></blockquote>
BUBU
<blockquote class='ipsBlockquote' data-author="'BUBU'" data-cid="82758" data-time="1316024544" data-date="14 September 2011 - 11:22 AM"><p>
mwilliams
The exception you're getting is because you're trying to use date formatting on a string date field "todayDate". If you parse this into a date type, the error will go away.
BUBU
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="82763" data-time="1316026249" data-date="14 September 2011 - 11:50 AM"><p>
The exception you're getting is because you're trying to use date formatting on a string date field "todayDate". If you parse this into a date type, the error will go away.<br /></p></blockquote>
<br />
<br />
<br />
sir i have create taht same issue with a same flatfile datasource.i hve attached that CSV file and rptdesign file.so that u can be abble to know where i stuck...PFA
mwilliams
The problem that you're having currently is the value of your bar always being 100. This is because you've chosen the "percent stacked bar chart". The bars on this are always up to 100 because it's 100%. Each value in a category stack will take up its percent of that stacked bar. In your case, you only have one value, so it always takes up 100%. If you switch to a normal bar chart, you'll see what you're looking for.
johnw
The Java Gregorian Calendar class will get the days in month pretty easily. Try something like:
importPackage(Packages.java.util);
// Create a calendar object of the desired month
var cal = new GregorianCalendar(1999, Calendar.FEBRUARY, 1);
// Get the number of days in that month
var days = cal.getActualMaximum(Calendar.DAY_OF_MONTH); // 28
This will work for Leap Years as well.
mwilliams
Thanks, John! My last post seemed a little off because I had been talking to him on facebook chat!