Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Data Summation/Math Manipulation
cwoggon
I have some fields in a single data set that I would like to combine into one 'variable' that I can use throughout a grid in my report.
i.e.:
Variable1 = Field1+(Field2*(Field3/(Field4-Field5)))
This 'variable' may then be combined with yet another field or 'variable' and placed into a cell on a grid.
But for the life of me I can't seem to figure out a quick and easy way to accomplish my goal.
Does anyone have any input/tips/tricks for doing such a task?
If this has already been answered somewhere else please redirect me to that solution.
Thanks
-Chris
Find more posts tagged with
Comments
mwilliams
Hi Chris,
Is there only one row in this dataSet? Or are there going to be many of these variables for different rows of the dataSet?
cwoggon
I have two cases:
1) one row with multiple columns that need to be added together
2) multiple rows with multiple columns that need to be added together (for this one I resorted to combining the columns inside my database and using computed columns inside BIRT to add the data together)
Also if you happen to know an easy way to sum multiple fields in multiple data sets I would be happy to hear it.
i.e. I want to make a grand total of the column sums I created for each data set.
BIRT is an amazing tool, but the stuff that I think should be easy to accomplish I can't figure out - that or I'm completely missing a built in feature somewhere...
EDIT: It would also be acceptable if I could manage to sum a column of a GRID even though the entries of the grid are from multiple data sets.
mwilliams
Chris,
If you stored values in variables in the script of each data element in your grid, you could use these variables to create a computed value in another location like you're wanting. If you would like an example, I'm sure I could make one real quick. Just let me know what version of BIRT you're using, or set up a sample report that I can run with the sample database or a flat file or something how you'd like it and I'll modify it.
cwoggon
I managed to script a way to get my totals done and took care of the other issues with different queries.
Now my only problem is trying to format the output of the script. I need to get the INTs (i.e. 1234) that are coming out into a currency format (i.e. $1,234).
Got any ideas?
BIRT 2.5 by the way.
mwilliams
Chris,
And you're not using data elements?
cwoggon
I couldn't get my script to properly update a data element so I did a this.text = formula.
I scripted a way to properly format the numbers as well.
Thanks for the assistance.