Skip to main content



      Home
Home » Archived » BIRT » Using Array data in graphs(how do I deconstuct array data in a single column for use in graph)
Using Array data in graphs [message #684057] Tue, 14 June 2011 19:28 Go to next message
Eclipse UserFriend
Hi,
I am trying to graph the number of users online for each of the 24 hours in a day. I have the login time and the logout time, and have created a function which returns an array of 24 numbers which represent the 24 hours in a day, and has a value of 1 if the user was online during the hour and 0 otherwise ie for user online from 10am to 2pm this is the array values (0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0).

When included in the SQL query the above array becomes a single column.

Can I use this data in this format or not? I need to get statistics like the total number online for each hour (array element) ie sum(arrayhour[3]) and then display the results graphically.

I need to keep the hour data with the rest of the columns so that I can analyse login times by branch,dept,total/user/mth etc.

I have a very clutzy solution which involves 24 functions one for each hour, which are each called once in the query, and so return 24 columns. However if I can use the array it would be better.

Thanks for your help
Chris
Re: Using Array data in graphs [message #684382 is a reply to message #684057] Wed, 15 June 2011 10:06 Go to previous messageGo to next message
Eclipse UserFriend
Chris,

If the column is a string you could always add a computed column. Set
its type to Java Object and enter this expression:
dataSetRow["longcol"].split(",");

Then you get at values like:
dataSetRow["myjavaobjectcolumn"][12]

Which should also work with aggregation elements.

Jason

On 6/14/2011 7:28 PM, Chris wrote:
> Hi,
> I am trying to graph the number of users online for each of the 24 hours
> in a day. I have the login time and the logout time, and have created a
> function which returns an array of 24 numbers which represent the 24
> hours in a day, and has a value of 1 if the user was online during the
> hour and 0 otherwise ie for user online from 10am to 2pm this is the
> array values (0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0).
>
> When included in the SQL query the above array becomes a single column.
>
> Can I use this data in this format or not? I need to get statistics like
> the total number online for each hour (array element) ie
> sum(arrayhour[3]) and then display the results graphically.
>
> I need to keep the hour data with the rest of the columns so that I can
> analyse login times by branch,dept,total/user/mth etc.
>
> I have a very clutzy solution which involves 24 functions one for each
> hour, which are each called once in the query, and so return 24 columns.
> However if I can use the array it would be better.
>
> Thanks for your help
> Chris
Re: Using Array data in graphs [message #684619 is a reply to message #684382] Wed, 15 June 2011 19:46 Go to previous message
Eclipse UserFriend
Thanks Jason,
I thought there had to be an easier way. It works beautifully.
Chris
Previous Topic:Data is getting truncated in the PDF out put
Next Topic:Newbie: web viewer report - html set left margin
Goto Forum:
  


Current Time: Fri Jul 04 19:48:48 EDT 2025

Powered by FUDForum. Page generated in 0.03019 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top