Jump to content

Crosstab with variances


sgarciaf

Recommended Posts

Hi,

 

I have a crosstab in iReports 4.0.1 that looks like:

                      TypeA       TypeB     TypeC ...

Year1                1               3              2

Year2                3               1              2

...

 

I want to add a new row between each two years to show the variance between the two years:

                            TypeA       TypeB     TypeC ...

Year1                      1               3              2

Year2vsYear1           2              -2              0

Year2                      3               1              2

...

 

Can I do this with the crosstab properties o I have to make it with the sql sentence?

 

Thank you!

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

I do not think this is possible. At least not using the cross tab features. Since the Year 2 row has not been calculated at the time of the Year2vsYear1 row. You might be able to get it to work moving the Year2vsYear1 to the end:

Year1

Year2

Year2vsYear1

You would need to add a column in your query that groups Year1 and year2 and then use that group in the cross tab. You could also pre-calculate the Year2vsYear1 row in your query but then you are probably better off using a subreport or a table instead of a cross tab.

I hope this helps,

Magnus



Post Edited by phantastes at 07/18/2011 15:30
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...