Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsBirtDuration.day
https://www.eclipse.org/forums/index.php/mv/msg/172041/547290/#msg_547290
I need to get a quantity per day from a cube.
My cube shows quantity for each month and I want to add a second line to
calculate the average quantity per day.
To do that I have to know how many days has a month.
I read that Birt has a BirtDuration.day(lexicalDuration) function, but I
didn't understand how to pass my month.
Any suggestions, please?
Thank you
nicola]]>Nicola2010-07-16T08:18:05-00:00Re: BirtDuration.day
https://www.eclipse.org/forums/index.php/mv/msg/172041/547370/#msg_547370
There are some libraries out there which provide a "daysInMonth" function - that would simplify your life but I don't think we have it available to us.
I'll leave the specific syntax of some of the functions to you as I'm not in my environment.
Given as available fields [amount] and [date]
If [date].Month in [9,4,6,11] then [amount] / 30.0;
If [date].Month in [1, 3, 5, 7, 8, 10, 12] then [amount] / 31.0;
If [date].Month = 2 and [date].Year mod 4 = 0 then [amount] / 29.0;
If [date].Month = 2 and [date].Year mod 4 != 0 then [amount] / 28.0;