Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 23:28 Go to next message
Chris  is currently offline Chris Friend
Messages: 47
Registered: September 2010
Member
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 14:06 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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 23:46 Go to previous message
Chris  is currently offline Chris Friend
Messages: 47
Registered: September 2010
Member
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 Apr 19 20:33:34 GMT 2024

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

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

Back to the top