Jump to content
JasperReports Library 7.0 is now available ×

How to get multiple variations of counts of the same data set?


rtucci

Recommended Posts

I have a set of Customer Survey data, the status field tells me if the survey was ignored or responded to, I need the total number of surveys setn and the total responded to.

I have the total sent, but can not figure out how to get the second set.

I tryed a sub report (this gives ne the option of using w where clause) but i do not know how to pass the date perameter from the main report to the sub.

So I am asking for help to see if this can be done using a query statement in the mani report and not using a subreport.

Thanks

RT

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi RT,

create a new Variable with the following settings:

Name: MyCounter

Calculation: Nothing

Reset: Report

Increment: None

Variable Expression: ($F{<responded-or-not-boolean-field-value>} == true ? $V{MyCounter} + 1 : $V{MyCounter}

Initial Value: 0

that should do it. Another way of defining the variable would be:

Name: MyCounter

Calculation: Count

Reset: Report

Increment: None

Variable Expression: ($F{<responded-or-not-boolean-field-value>} == true ? 1 : null

Initial Value: 0

This approach uses the fact, that the count-calculation function only count values different from null

Cheers, Thomas

http://www.thomaszimmer.net

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...