Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsMEDIAN function on string???
https://www.eclipse.org/forums/index.php/mv/msg/245791/735945/#msg_735945
I have this column which represents difference between some actual and target start.Using DB2 functions timestampdiff,Floor and Mod I have this difference in format days--hours--minutes.
Now my customer wants median value of that column.
By using embedded MEDIAN function in BIRT I receive as result only "0".
In this case result should be 0 days 0 hours 1 minutes.
Is it possible to have median result in this format?
Thanks]]>Dejan Vujanic2011-10-13T07:28:26-00:00Re: MEDIAN function on string???
https://www.eclipse.org/forums/index.php/mv/msg/245791/736113/#msg_736113
computed column to convert it to a string. Have a look at the attached
example. Specifically look at the two computed columns on the dataset.
Jason
On 10/13/2011 3:28 AM, cankovicv wrote:
> I have this column which represents difference between some actual and target start.Using DB2 functions timestampdiff,Floor and Mod I have this difference in format days--hours--minutes.
> Now my customer wants median value of that column.
> By using embedded MEDIAN function in BIRT I receive as result only "0".
> In this case result should be 0 days 0 hours 1 minutes.
> Is it possible to have median result in this format?
>
> Thanks]]>Jason Weathersby2011-10-13T15:44:32-00:00Re: MEDIAN function on string???
https://www.eclipse.org/forums/index.php/mv/msg/245791/741202/#msg_741202
You send me great example and I did it all like you. My computed column Median Minutes is always correct calculated but medianstring computed column is always empty.
I don't know why? I tried with some simple example just as Float to calculate from Median Computed column divided by 24 but that is also empty. Do you see maybe what is wrong? Here is all settings:
]]>Dejan Vujanic2011-10-19T09:36:47-00:00Re: MEDIAN function on string???
https://www.eclipse.org/forums/index.php/mv/msg/245791/741215/#msg_741215
You send me great example and I did it all like you. My Median Minutes column is always correct calculated but medianstring column is always empty. I copy paste your example but it stays empty. I tried and with simple example to use that column as Float-- Median Minutes divided with 24 but it stays empty. Do you maybe see what am I doing wrong? Here is all the settings:
]]>Dejan Vujanic2011-10-19T09:51:11-00:00Re: MEDIAN function on string???
https://www.eclipse.org/forums/index.php/mv/msg/245791/741275/#msg_741275
thanks for help
]]>Dejan Vujanic2011-10-19T11:10:13-00:00Re: MEDIAN function on string???
https://www.eclipse.org/forums/index.php/mv/msg/245791/741449/#msg_741449
use this expression:
var mytime = row["MedianMinutes"];
tst = "Testing " + mytime
Jason
On 10/19/2011 7:10 AM, cankovicv wrote:
> Jason just to add-- I added new computed column which calculates from standard output column INCIDENTID and that works ok. But for similar expression medianstring stays empty. It's like medianstring cant pull out information from computed Median Minutes column. do you know the reason?
> thanks for help
>
>
>]]>Jason Weathersby2011-10-19T14:44:01-00:00Re: MEDIAN function on string???
https://www.eclipse.org/forums/index.php/mv/msg/245791/742140/#msg_742140
It's again empty.
But never mind I succeeded to present median string results. Solution was that I used only one computed column (Median Minutes) and on report medianstring column is not bound to medianstring computed column.I bound it with expression
var mytime = row["MedianMinutes"];
var mytime3=BirtMath.roundDown(BirtMath.divide(BirtMath.mod(mytime,1440),60),0);
var mytime2=BirtMath.roundDown(BirtMath.divide(mytime,1440),0);
mytime2 + "days " + mytime3 + " hours " + mytime%60 + " minutes";
Now it works OK. I just have only one question can I display this result just in one field-out of the table in some field. Because this result can be repeted n-times through the table as you can see in attachment. I saw also that in your example also there was repetition of result?? Can it be shown only once??
Thanks,best regards
]]>Dejan Vujanic2011-10-20T08:05:51-00:00Re: MEDIAN function on string???
https://www.eclipse.org/forums/index.php/mv/msg/245791/742494/#msg_742494
There is a check box to suppress duplicates.
Jason
On 10/20/2011 4:05 AM, cankovicv wrote:
> Hi Jason.
>
> It's again empty.
> But never mind I succeeded to present median string results. Solution was that I used only one computed column (Median Minutes) and on report medianstring column is not bound to medianstring computed column.I bound it with expression
>
> var mytime = row["MedianMinutes"];
> var mytime3=BirtMath.roundDown(BirtMath.divide(BirtMath.mod(mytime,1440),60),0);
> var mytime2=BirtMath.roundDown(BirtMath.divide(mytime,1440),0);
> mytime2 + "days " + mytime3 + " hours " + mytime%60 + " minutes";
>
>
> Now it works OK. I just have only one question can I display this result just in one field-out of the table in some field. Because this result can be repeted n-times through the table as you can see in attachment. I saw also that in your example also there was repetition of result?? Can it be shown only once??
>
> Thanks,best regards
>
>
>]]>Jason Weathersby2011-10-20T14:44:32-00:00Re: MEDIAN function on string???
https://www.eclipse.org/forums/index.php/mv/msg/245791/743209/#msg_743209
I thought that maybe there is a way to present it out of table but this is OK also.
Cheers, wish you all the best!]]>Dejan Vujanic2011-10-21T08:17:13-00:00