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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

count with accross

Status
Not open for further replies.

Ericordina

Technical User
Nov 28, 2006
10
NL
I have also an other problem (sample from empdata)

If i have an collumn salary and thats accrossed by year

How is then possible to generete an formule wich
can count the salary of year minus salary-1 /salary of year *100
 
To get relationships between columns, when using an ACROSS, you can add a COMPUTE as a verb object. Then you reference the prior column by using the LAST operator (make SURE that the field which determines the 'last' value is the last sort field (in your example, that would be YEAR). The COMPUTE logic should check for a change in higher sort fields. Here's an example, using the CAR file:
Code:
TABLE FILE CAR
SUM SEATS
COMPUTE PCTDIFF/F6.2=IF BODYTYPE NE LAST BODYTYPE THEN 0
                     ELSE (LAST SEATS/SEATS) * 100;
BY BODYTYPE ACROSS COUNTRY
END
In this example, I compare values of higher sort fields (here 'BODYTYPE'), so I don't compare values for different COUNTRY values.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top