Jump to content
Changes to the Jaspersoft community edition download ×

justin.watts

Members
  • Posts

    14
  • Joined

  • Last visited

justin.watts's Achievements

Apprentice

Apprentice (3/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. Hello, I am trying to filter data in the .jrxml by the value of a created variable. $V{ABOnly} is expressed by $V{GradeACount} + $V{GradeBCount} == $V{CourseGradeCount} ? 1 : 0. When I use the filter expression $V{ABOnly} == 1, instead of limiting to just the records where $V{ABOnly} is equal to 1, the report just sets the value of $V{ABOnly} to 1 for every record. How do I get this to work?
  2. Hello, I have a division formulat that is causing some discrepancies in the final calculation. Here is the formula: $V{GroupByAdvAcadCount}.divide($V{LocationStuCount},5,RoundingMode.HALF_UP).multiply(new BigDecimal(100)) I'm basically getting the percentage a group at each row. For 2 distinct groups (2 different rows in the report) I have 284 for $V{LocationStuCount} and 49 for $V{GroupByAdvAcadCount} for both rows/groups. However, the final calculation brings back 17.75% for one group and 17.25% for the other group. How is this possible if the numerator and the denominator are the same for both groups? Both should be 17.25%. Does the formula need to be adjusted in any way? I've had this happen a few times whenever I'm using division with 2 different groups and the reset types are for different groups. Is there any way around this? It only happens when I have multiple rows for a group.
  3. Hello, I have an expression to get a percentage for each group. However, the percentages don't calculate correctly for every group and some are not even close to being correct. Here is my expression: $V{GTCount}.divide($V{StuCount},5,RoundingMode.HALF_UP).multiply(new BigDecimal(100)) I have my reset type set to my group (Group By). For my first record, I have 146 for the GTCount and 2056 for the StuCount. However, my percentage comes out to 21.89 and it should be 7.10. Why is this so far off? Some of these calculations are closer in accuracy (for example, in another record I have 1 for the GTCount and 2056 for the StuCount and I get 0.05, which is correct), but most of them are off. Is there something in my formula that is causing this?
  4. My apologies. The expression I am using is: $P{Number} >= $V{TotalDays} ? Boolean.TRUE : Boolean.FALSE
  5. Hello, I am trying to add a filter expression to show only the records based on >= parameter input. I have a parameter ($P{Number}) that is set to integer. I have a variable ($V{TotalDays}) that is also set to integer. What I want to do is show only the records where $V{TotalDays} is greater than or equal to the input of $P{Number}. I have tried various expressions, but can not find the correct one that will limit records accordingly. The below expression has been the most promising, but it still does not work completely. When I enter 0 for the $P{Number}, it doesn't disaply any records and it should dispaly all of the records. When I enter 3 for the $P{Number}, it limits it to a couple of records. However, one of those records has a 1 for $V{TotalDays} (which should not show since I entered 3 for $P{Number}). The other record does indeed have a 3 for $V{TotalDays}, but there are numerous records that have a $V{TotalDays} greater than or equal to 3 that are not showing. Why would it not show all records when a 0 is entered and only a record for 1 $V{TotalDays} and a record for $V{TotalDays} when 3 is entered. How do I use a filter expression for integers? $P{PlaceLimit} >= $V{TotalPEIMSDays} ? Boolean.TRUE : Boolean.FALSE
  6. I tried the following expression, but getting an error that integer cannot be cast to boolean. Both the $P and the $V are set to integer class; will not work with bigDecimal either. IF($V{TotalPEIMSDays} >= $P{PlaceLimit},$V{TotalPEIMSDays},$V{TotalPEIMSDays})
  7. I think the issue I am having is I'm trying to do == in one part of the expression and then do >= in another part of the expression, which I haven't found out how to do successfully. Is there a way to simply say $V{TotalPEIMSDays} >= $P{PlacementDays}? What class do the variables and parameters have to be? I
  8. I am using SQL to retrieve data. It seems I'm making it harder that it should be. All I want to say is show records based on the following formula: Where $V{TotalPEIMSDays} >= $P{PlacementDays} Both the variable and parameter are set to Integer class. $P{PlacementDays} is just the parameter input for the user. $V{TotalPEIMSDays} is a created variable by taking the sum of a field pulled from the SQL (ACTUAL_PEIMS_DAYS, which is also set to Integer).
  9. I'm trying to use the filter expression, but I can't find a formula that filters my data accordingly. I have one parameter (PlacementDays) and one variable (TotalPEIMSDays). They both are set to class BigDecimal. I am trying to say the following: When $P{PlacmentDays} is entered as 0, then show me all records, else show me records where $V{TotalPEIMSDays} >= $P{PlacementDays}(based on input by user). How do I accomplish this?
  10. I am using the filter expression in the dataset and query dialog, but can't get my expression to work correctly. I have used two expressions. Expression 1: "0".equals($P{PlacementDays}) ? $V{TotalPEIMSDays}.compareTo(BigDecimal.ZERO) > 0 : $V{TotalPEIMSDays}.compareTo(BigDecimal.ZERO) >= $P{PlacementDays} $P{PlacementDays} is set to BigDecimal. $V{TotalPEIMSDays} is set to BigDecimal. When I use this expression, I get an error saying "the operator >= is undefined for the arguments types int, BigDecimal, which I don't understand since I have both the parameter and the variable set to BigDecimal. Expression 2: "0".equals($P{PlacementDays}) ? $V{TotalPEIMSDays} > 0 : $V{TotalPEIMSDays} >= $P{PlacementDays} In this expression, I set both the parameter and variable to integers. It works when 0 is entered, but when I use a number other than 0, it does not limit the records accordingly. Essentially, what I am trying to say is when $P{PlacementDays} = 0 then show all records, else show me the records that are >= $P{PlacementDays}
  11. Hello, Inside a .jrxml, is there a way to show only the records based on the input of a parameter? For example, if I have a parameter (NumOfAbsences) and want to show only the records >= to the input of that parameter, how would I go about doing so?
  12. Still having an issue with this. If I have a group total of 2 (which would be 2/662), I get 0.01 for one group. However, in another group I have total of 2 and it come out to 0.14. I have the calculating variable set the evaluation time of the group. Is there something I should be using besides Rounding.Mode.HALF_UP? The calculations vary from group to group.
  13. I am trying to do division between a group count and a report count, but the calculations are not coming out correct. Here are my variable: DiscIncCount - doing a simple count calculation and resetting by group TotalDiscIncCount - doing a simple count calculation and resetting by report DiscIncPercent - $V{DiscIncCount}.divide($V{TotalDiscIncCount},2,RoundingMode.HALF_UP) - the calculations for this variable is not coming out correctly. For example, if I have 4 for one of the group totals and 640 for the report total (4/640), it should come out to .63, but it is coming out to .01. All of these variable are set to BigDecimal class.
×
×
  • Create New...