Jump to content
Changes to the Jaspersoft community edition download ×

Crosstab report Measure count


sach411

Recommended Posts

I have a simple crosstab report as below.

And I need the count of non-zero measure. i.e. if any Account has non-zero value, it is counted as 1. and counts across row are printed in the last column.

 

 Account1Account2Account3NonZero Value Count
2012320452
20131216113
20140011111
20150000

 

I'm trying to add variables, measures however unable to figure out.

Please share any thought on how this can be achived in jasper report without using any java code.. i.e. purely in JRXML.

 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Try this.

create 4 varaibles v1,v2,v3,v4 of integer data type

v1 -> $F{Account1} == 0 ? 0:1

v2 -> $F{Account2} == 0 ? 0:1

v3 -> $F{Account3} == 0 ?  0:1

v4-> $V{v1}+$V{v2}+$V{v3}

create a new column label as NonZero Value Count(  - column header )and have the value as $V{v4} ( - detail band)

Let me know if you face any issue

 

 

 

 

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