|
Re: MEDIAN function on string??? [message #736113 is a reply to message #735945] |
Thu, 13 October 2011 15:44 |
|
You could always use birt date diff on the minute and then use another
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
-
Attachment: median.zip
(Size: 2.79KB, Downloaded 267 times)
|
|
|
|
|
|
Re: MEDIAN function on string??? [message #741449 is a reply to message #741275] |
Wed, 19 October 2011 14:44 |
|
What happens if you change the type of medianstring to String and then
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
>
>
>
|
|
|
|
Re: MEDIAN function on string??? [message #742494 is a reply to message #742140] |
Thu, 20 October 2011 14:44 |
|
Select the column on the table and look in the general properties.
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
>
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03900 seconds