Jump to content
We've recently updated our Privacy Statement, available here ×

Why a Simple Crosstab doesn't Work!?


amadei
Go to solution Solved by H Mendoza,

Recommended Posts

I have this simple data table:

YEARCAUSAL NAMEMONTHVALUE
2017FIRST1100
2017SECOND1200
2017FIRST2150
2017SECOND2500
2016FIRST1400
2016SECOND1300
2016THIRTH1120
2016FIRST2100
2016SECOND3400

I'm creating a report with a group by year. I want a cross tab for every year.

In cross tab's columns I need the available months. In cross tab's rows I need the causal name. 

Somethings like this:

YEAR: 2017

CAUSAL NAMEGENFEB
FIRST100150
SECOND200500

YEAR: 2016

CAUSAL NAMEGENFEBMAR
FIRST4001000
SECOND3000400
THIRTH12000

I put crosstab in GroupFooter and I have set the reset value of dataset to Group.

I down know why but I get value "1" in every cell of crosstab. I've tried the simplest version of report with one year and one month. Every causal has a value so no "empty" cell has to be managed.

report(9).png.09d60fee5293483571d9aeddc88c9b92.png

Please, help me!

Thanks!

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Hugo Mendoza's andwer guided me to solve the problem.

I'm using Jaspersoft Studio. During Crosstab Wizard, when you select the field to put inside the cell, the default "aggregate function" is count. Changing the function during the wizard, rise a Null Pointer Exception so leave "count" as function.
 
Now, edit the Crosstab and use "SUM" function for your measure. If you use "none" as function, the value will be printed correctly in the cell but TOTALS Cells doesn't work. So us SUM for your measure.

 

 

 

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