Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Top N Chart for categorical data
jakoby84
Hello,
in advance: I'm sorry if the question is very basic or if it was asked before. But I tried googling and searching the forum, maybe I don't use the correct search terms or whatever... Any help is very much appreciated!
So I have a table with logging data. Each row represents one log entry and I want to show a chart with the top five users (column LOGUSER). So I have to count how many times a user occurs in the result set and then use that number as the series value.
Could you please help me to figure out how to do that? Any good resources, tutorials or quick explanations?
Regards, Jakob
Find more posts tagged with
Comments
Jenkinsj5
Basic answer: In your dataset use a computed column to count the occurrences. There are a lot of ways to do this, depending on your skill set.
If you need more help, just ask.
jakoby84
<blockquote class='ipsBlockquote' data-author="'Jenkinsj5'" data-cid="113236" data-time="1358187401" data-date="14 January 2013 - 11:16 AM"><p>
Basic answer: In your dataset use a computed column to count the occurrences. There are a lot of ways to do this, depending on your skill set.<br />
<br />
If you need more help, just ask.<br /></p></blockquote>
Thanks for your answer so far.<br />
<br />
So as I understand, I doubleclick the dataset, in computed columns tab I add a new column, datatype: Integer, Aggregation: COUNT, Expression: row["LOGUSER"] (that's the column containing the user names for which I want to get the count). But this gives me the same number for all rows of the dataset (I guess it is because the data is not grouped but just all rows in the dataset are counted?).<br />
<br />
So do I specify the wrong aggregation or do I have to write a javascript expression to count values 'manually'? If so, could you give a hint, because although I'm a (still learning) programmer, I sometimes don't get what BIRT expects in the expression fields.
Hans_vd
Not sure if you can do it using a computed column in the data set.
Also no sure about my skillset, but as far as I'm concerned, this problem is rather difficult to solve.
An easy solution is to do the counting in the query and filter on the resulting column.
Another solution is described here:
http://enterprisesmartapps.wordpress.com/2013/01/15/birt-chart-filter-on-the-values-series/
Hope it helps
Hans
jakoby84
<blockquote class='ipsBlockquote' data-author="'Hans_vd'" data-cid="113267" data-time="1358245302" data-date="15 January 2013 - 03:21 AM"><p>
Another solution is described here: <a class='bbc_url' href='
http://enterprisesmartapps.wordpress.com/2013/01/15/birt-chart-filter-on-the-values-series/'>http://enterprisesmartapps.wordpress.com/2013/01/15/birt-chart-filter-on-the-values-series/</a><br
/></p></blockquote>
<br />
Ok, so at least there is no direct solution apparently and I'm glad I didn't oversee some very obvious thing.<br />
Thanks a lot for the link, it seems to describe exactly the workaround I was looking for
Hans_vd
<blockquote class='ipsBlockquote' ><p>Thanks a lot for the link, it seems to describe exactly the workaround I was looking for</p></blockquote>
Well, I read your question and quickly wrote the blog, so yes, it describes exactly what you were looking for :-)
Jenkinsj5
<blockquote class='ipsBlockquote' data-author="'Hans_vd'" data-cid="113305" data-time="1358321592" data-date="16 January 2013 - 12:33 AM"><p>
yes, it describes exactly what you were looking for :-)<br /></p></blockquote>
<br />
And much cleaner then the solution I was imagining.
Hans_vd
Hi Jenkinsj5,
Actually, I'm still wondering how you would have done it, using a computed column in the data set.
Jenkinsj5
My approach was to use, order by the LOGUSER (or what ever is being counted) in the SQL, count using 'RUNNINGCOUNT' Aggregation, with a computed column (or three) that indicated the LOGUSER of the previous line, and restart the count when the LOGUSER of the previous line was different then the current line.
I was working on a global report variable that would carry the LOGUSER with each line, when you posted your solution. For which I am greatfull, as mine was getting ugly.