Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] FIND DIFFERENCE ACROSS USING OVER

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] FIND DIFFERENCE ACROSS USING OVER
 Login/Join
 
Gold member
posted
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
 
Posts: 93 | Registered: February 20, 2008Report This Post
Virtuoso
posted Hide Post
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
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] FIND DIFFERENCE ACROSS USING OVER

Copyright © 1996-2020 Information Builders