Focal Point
[SOLVED] FIND DIFFERENCE ACROSS USING OVER

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/707108374

June 24, 2010, 06:08 PM
BobV
[SOLVED] FIND DIFFERENCE ACROSS USING OVER
Thanks GamP. This helped me get a start. Thought it might have something to do with using LAST command, but have not used it that much.
Instead of just COMPUTE DIFF1 = LAST CUST_Y_PCT - CUST_Y_PCT; OVER I added:

IF CHNL_TYP EQ 'X' THEN LAST CUST_Y_PCT - CUST_Y_PCT ELSE 0; Otherwise, there was a calculation for the first ACROSS value which is zero - whatever value. This way, there was only a value displayed for the difference between the two across columns. But, not only did I not want calculated values outside of the values between across columns, I did not want to show anything. So...

I changed from ACROSS CHNL_TYP to BY, removed OVER's and HELD it. Then I built another report summed data using ACROSS and OVER's. This way, I was able to get that DIFF displayed in a footer.

Not sure if there is a simpler way, but this works the way I want.

thanks again, could not have done it without the advice.

Bob

This message has been edited. Last edited by: BobV,


WF (App Studio) 8.2.01m / Windows
Mainframe FOCUS 8
June 25, 2010, 03:56 AM
GamP
Maybe siomething like this is what you're looking for?
TABLE FILE CUSTOMER
SUM   CNT.CUST OVER
      CUST_Y OVER
      COMPUTE CUST_Y_PCT/D12.2%= ( CUST_Y / CNT.CUST ) * 100; OVER
	  COMPUTE DIFF1 = LAST CUST_Y_PCT - CUST_Y_PCT; OVER
      CUST_N OVER 
      COMPUTE CUST_N_PCT/D12.2%= ( CUST_N / CNT.CUST ) * 100; OVER
	  COMPUTE DIFF2 = LAST CUST_N_PCT - CUST_N_PCT;
ACROSS CHNL_TYP
ACROSS-TOTAL AS 'TOTALS' AND RECOMPUTE
END



GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988