sugra Posted September 18, 2009 Share Posted September 18, 2009 Good day, I need some help with writing an expression. My query pulls data related to all product categories, however I need a field that sums data related only to categories that are equal to 2 specific categories. E.g. Business, Personal. Does anyone have suggestions? I would be very grateful. Link to comment Share on other sites More sharing options...
phantastes Posted September 18, 2009 Share Posted September 18, 2009 Hi,you could try creating a category group. Then set up the summary variables for that group. Place those variables in the group footer. Now in the "Print When Expression" specify to only print the band when the two categories you want printed comes up ie new Boolean($F{groupName}.equalsIgnoreCase("Business") || $F{groupName}.equalsIgnoreCase("Personal")). And don't forget to sort the values by your group.Magnus Link to comment Share on other sites More sharing options...
sugra Posted September 18, 2009 Author Share Posted September 18, 2009 Thank you so much for your response.I tried it and I got a report that printed only values where the product category is Business and Personal.Is there anyway that I could have just one field that adds/sums only those records where category = Business or Personal? Link to comment Share on other sites More sharing options...
phantastes Posted September 21, 2009 Share Posted September 21, 2009 Hi,not sure if I understand exactly what you are trying to do but it sounds like you want a variable that only counts values of certain grouptypes?If that's the case then add a new variable. Set it to Calculation Type = Count. In variable expression field write something like this:$F{groupName}.equalsIgnoreCase("Business") || $F{groupName}.equalsIgnoreCase("Personal") ? $F{groupName} : null I hope that helps! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now