[CLOSED] SUBTOTAL Is '0" (Zero) With Conditional Compute. Need Help Fixing
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
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 ''
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
I am currently in 8201
Thanks in Advance!This message has been edited. Last edited by: Brandon Andrathy,
December 19, 2018, 12:56 AM
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;
ON COUNTRY RECOMPUTE
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
December 19, 2018, 09:47 AM
Wow! You are definitely on top of your game. That was exactly what was happening . Worked like a charm. Thanks a ton!!!