Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

% change continue / how to reference an object to include in a formula

Status
Not open for further replies.

AlphaThis

IS-IT--Management
Apr 20, 2010
5
US
thread767-675253
Hi!
Crystal Reports 10 here.

This is very close to what we are trying to achieve here:
The items are grouped by ItemNumber so:
Item Number 1:
Table
Item Number 2:
Table
Item Number 3:
Table
This is what the Table is:
Year Period1 Period2 Period3
2009 959 252 353<--------------(Quantity of goods Sold= QtySoldPeriod)
2010 622 346 233<--------------(Quantity of goods Sold= QtySoldPeriod)

% Change X Y Z

Percent Change of Period1 of Item Number N= (622-959)/959
or
(QtySoldPeriod1(2010) - QtySoldPeriod1(2009)) / QtySoldPeriod1(2009)

This formula of yours worked perfectly for the first period:
WhilePrintingRecords;
StringVar result := "";
if not onLastRecord then
(
if previous({View_Inventorytest.QtySoldPeriod1}) = 0 then
result := "Inf" // infinately big change
else
result := totext(({View_Inventorytest.QtySoldPeriod1} - previous({View_Inventorytest.QtySoldPeriod1}))/previous({View_Inventorytest.QtySoldPeriod1}) * 100,2) + "%";
);
result;

So i got the value of X.
But it did not accept the formula for Y, i did change the "Inventorytest.QtySoldPeriod1" variable to " Inventorytest.QtySoldPeriod2" of course but didnt work.
What am i doing wrong? better yet, is there a syntax that can select an actual value?
For instance: The "QtySoldPeriod" of "2009" of "Item Number1" that way i can just plug those into the formula and all is well.

I hope i wasnt too long please help!!!!!
Thank you

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top