Focal Point
[CLOSED] SUBTOTAL Is '0" (Zero) With Conditional Compute. Need Help Fixing

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

December 18, 2018, 04:31 PM
Brandon Andrathy
[CLOSED] SUBTOTAL Is '0" (Zero) With Conditional Compute. Need Help Fixing
Hello,

I am currently working with a table that has to have each value stored in the COLVAL_NEW COMPUTE Statement in the below code. I'm so so close however when I try to do a subtotal RECOMPUTE on the "BY PROVIDERNAME" field, the field within the IF SUMID EQ '3' statement has 0 values in the subtotal but populates for the ELSE COLVAL/CNT_RAF part of the statement. Can anyone explain why/how to fix it? The reason I need to use one field is because I'm using Universal Concatenation (MORE FILE).

 

TABLE FILE PREV_YEAR_NEW_1
SUM
	COLVAL NOPRINT
	CNT_RAF NOPRINT
	COMPUTE COLVAL_DEC/P20.2 = IF TREND_DEC_2 EQ 'Y' THEN COLVAL/CNT_RAF ELSE 0; NOPRINT
	COMPUTE COLVAL_NEW/P20.2 = IF SUMID EQ '3' THEN (RAF_CURRENT/MEM_CURRENT) - (RAF_PREVIOUS/MEM_PREVIOUS) ELSE COLVAL/CNT_RAF; AS ''
	RAF_CURRENT NOPRINT
	MEM_CURRENT NOPRINT
	RAF_PREVIOUS NOPRINT
	MEM_PREVIOUS NOPRINT
ACROSS COLID NOPRINT
ACROSS COLTXT AS ''
ACROSS DIMDATEKEYIDTRENDINGDATE NOPRINT
ACROSS TREND_DEC NOPRINT
ACROSS TREND_DEC_2 NOPRINT
ACROSS DATECALENDARKEY_YEAR_M AS ''
ACROSS DATECALENDARKEY_MONTH NOPRINT
ACROSS SUMID NOPRINT
ACROSS SUMTXT AS ''
BY DIMPROVIDERKEYID NOPRINT
BY PROVIDERNAME AS 'Provider' RECOMPUTE AS 'Provider'
BY HEALTHPLAN AS 'Health Plan'
BY CNT_MEMBER AS 'Current Population'
WHERE DIMPROVIDERKEYID NE MISSING OR 0
WHERE DIMDATEKEYIDTRENDINGDATE NE 0
ON TABLE SET ASNAMES ON
ON TABLE SET HOLDLIST PRINTONLY
END

 


I am currently in 8201

Thanks in Advance!

This message has been edited. Last edited by: Brandon Andrathy,


WebFOCUS 8204
December 19, 2018, 12:56 AM
Danny-SRL
Hi Brandon,
This due to the fact that when you use RECOMPUTE all fields are summed and COMPUTEd fields are recomputed.
Probably your SUMID is summed.
See the following usine the CAR file:
  
TABLE FILE CAR
SUM RCOST DCOST SALES CNT.SALES 
COMPUTE BSEATS/I3=SEATS / CNT.SEATS;
COMPUTE BRANDON/D9.2=IF BSEATS EQ 4 THEN DCOST / RCOST *100 ELSE SALES / CNT.SALES;
ACROSS SEATS
BY COUNTRY
BY CAR
ON COUNTRY RECOMPUTE
END



Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

December 19, 2018, 09:47 AM
Brandon Andrathy
Wow! You are definitely on top of your game. That was exactly what was happening Smiler . Worked like a charm. Thanks a ton!!!


WebFOCUS 8204