Jump to content
Changes to the Jaspersoft community edition download ×

How to get a count of records returned in an adhoc crosstab?


Recommended Posts

I am fairly new to JasperReports Server, but I'm getting the hang of it overall.  However, one thing is confounding me.  I cannot figure out how to get a count of records in a cross tab.

For example, my Incident domain contains fields for Region and Type, and a measure for Size (amongst other things).

I can create a crosstab that gives me the total (or average) size for incidents per Type across the top and Region down the left... but I cannot figure out how to get it to give me the total number of incidents in each.  Size is an optional field, so when I try putting it with Count All, I only get the number of non-null records, but I need the full total.

I figured out what feels like a hack - I put a calculated measure with a formala of "1" and then used Sum on that field, but that seems like the wrong thing to do.

Any help appreciated.  We're on version 7.0 right now but are about to update to 7.2.

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Re: answer from swood_1
I considered using Count All, but the problem with that is, unless I'm missing a different thing, it comes in REALLY ugly.  So in my results instead of saying something like "Number of Incidents" I get "Incident Primary Identifier (Count All)"

Is there a way in an ad-hoc view to rename a field?  Without creating calculated field of a different name that points to the original field and is just as much work as my original hack?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...