Variable Question


I have a report using many variables to calculate a rolling inventory over 16 months.  The users are requesting some difficult calculations in the rolling (or carryover) such as only carryover amounts > 0, but only for some categories(groups), and then add the carryover from one category to the carryover in another category.  I have most of the issues worked out, but I need to set a variable for the carryover ONLY when the group ="XXX", and maintain that variable value even when the group changes.  I can easily set the variable to change over categories (groups) $F{group1}=="XXX"?QTY_ON_HAND - QTY_ORDERED:0.0, but  when the group changes to "YYY" and then to "ZZZ" the value of the variable changes to 0.  I need to use the value of the varialble when it is in the "XXX" group as part of the calculation when it gets to group "ZZZ", but if it resets to 0 at that time, it is useless.

I have the Calculation set to "No Calculation", Increment and Reset types set to "None"

I am using Studio 5.5, but the same would apply to IReport Designer.

Thank you for your assistance.

Marlin Snyder


I have tried setting the Calculation Type to "First" and various settings on the Reset Type.  Group will set the value to 0.  None sets the value correctly, but it still changes with each group change.

marlin_snyder's picture
Joined: Jan 31 2013 - 4:37pm
Last seen: 3 months 8 hours ago

You need to set reset type to Report.Then it will come and also set calculation type none.If you have top level group then you can set it to group.


bschundawat143 - 6 years 9 months ago

I thought I had tried all combinations of reset type, calculation type and increment type.  Just to make sure, i went back and set them as recommended.  The variable still changes with each group.  Thank you for the suggestion.

marlin_snyder - 6 years 9 months ago

0 Answers:

No answers yet