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.

New TIBCO Community Coming Soon
In early summer, TIBCO plans to launch a new community—with a new user experience, enhanced search, and expanded capabilities for member engagement with answers and discussions! In advance of that, the current myibi community will be retired on April 30. We will continue to provide updates here on both the retirement of myibi and the new community launch.

What You Need to Know about Our New Community
We value the wealth of knowledge and engagement shared by community members and hope the new community will continue cultivating networking, knowledge sharing, and discussion.

During the transition period, from April 20th until the new community is launched this summer, myibi users should access the TIBCO WebFOCUS page to engage.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] report code caluculation issue

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] report code caluculation issue
 Login/Join
 
Silver Member
posted
I have below report program, the issue is the last calculation step won't get correct result:

DEFINE FILE FACT_CSRPBCLAIM
KEYFIELD/A200V = FACT_CSRPBCLAIM.REGION_NAME | FACT_CSRPBCLAIM.BUILDING_CODE | FACT_CSRPBCLAIM.CLINIC_NAME | FACT_CSRPBCLAIM.CLINIC_SUPERVISOR;

CLM_DATE1/YYMD = HDATE(CLM_PROCESS_DATE, 'YYMD');
STDT/MDYY = CLM_DATE1;
DAY_DOWK/I8YYMD = CLM_DATE1;
CLOSED_DT_DOW/A3=DOWK(DAY_DOWK, 'A3');
STWK/MDYY = DATEMOV (STDT, 'BOW') -2 ;
CLAIMCNT/I5 = 1;

END


TABLE FILE FACT_CSRPBCLAIM
SUM
CNT.INVOICE_NUMBER AS 'CLAIMCNT'
BY KEYFIELD
BY STWK
BY FACT_CSRPBCLAIM.REGION_NAME
BY FACT_CSRPBCLAIM.BUILDING_CODE
BY FACT_CSRPBCLAIM.CLINIC_NAME
BY FACT_CSRPBCLAIM.CLINIC_SUPERVISOR
BY HIGHEST 6 STWK
WHERE FACT_CSRPBCLAIM.REGION_NAME EQ ®ION;
WHERE FACT_CSRPBCLAIM.BUILDING_CODE EQ &SITECD;
WHERE FACT_CSRPBCLAIM.CLINIC_NAME EQ &CLINIC;
WHERE FACT_CSRPBCLAIM.CLINIC_SUPERVISOR EQ &SUPERVISOR;
WHERE CLM_PROCESS_DATE LE '&LASTRUNDATE';
-*WHERE CLM_PROCESS_DATE GE '&6LASTRUNDATE';
WHERE REGION_NAME IS-NOT MISSING;
ON TABLE HOLD AS HINV1 FORMAT FOCUS INDEX KEYFIELD
END
-RUN

JOIN FILE HINV1 AT KEYFIELD TAG CLM TO ALL
FILE HAPPDT AT KEYFIELD TAG APP AS JW1
WHERE CLM.KEYFIELD EQ APP.KEYFIELD;
WHERE CLM.STWK EQ APP.STWK;
END

TABLE FILE HINV1
SUM CLAIMCNT AS '6WKCLMCNT'
APPCNT/D6 AS '6WKMRNCNT'
COMPUTE PPB6/D8.2 = (CLAIMCNT/APPCNT); AS '6WKTRENDPBCLAIM'
BY KEYFIELD
BY REGION_NAME
BY BUILDING_CODE
BY CLINIC_NAME
BY CLINIC_SUPERVISOR
BY STWK
ON TABLE HOLD AS HINV2
END

-**************************************************************************
-* GET CURRENT TOTAL FOR PBCLAIM
-**************************************************************************

TABLE FILE HINV2
SUM 6WKCLMCNT AS 'CURCLMCNT'
6WKMRNCNT AS 'CURMRNCNT'
BY KEYFIELD
BY HIGHEST 1 STWK
BY REGION_NAME
BY BUILDING_CODE
BY CLINIC_NAME
BY CLINIC_SUPERVISOR
ON TABLE HOLD AS HINV3
END

---report code runs correctly here, when I run it I got CURCLMCNT=32 and CURMRNCNT=375 Smiler


JOIN KEYFIELD IN HCSRVOL
TO KEYFIELD IN HINV2 AS M4
END

JOIN KEYFIELD IN HCSRVOL
TO KEYFIELD IN HINV3 AS M5
END
-RUN

TABLE FILE HCSRVOL
SUM
COMPUTE CURPBCLAIMX/D8.2 = (CURCLMCNT / CURMRNCNT); AS ''
COMPUTE 6WKTRENDPBCLAIMX/D8.2 = (6WKCLMCNT / 6WKMRNCNT); AS ''

-- here we have problem the CURCLMCNT / CURMRNCNT accoring for abve is 32/375 =0.08
but I got 0.00 , don't know what is wrong
I am stuck and don't know what to look. can anyone help?

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 34 | Registered: December 17, 2012Report This Post
Virtuoso
posted Hide Post
What/where is HCSRVOL ?

And can you post all your code from the last table file ?

Remember that a COMPUTE only apply on sorted/filtered data.

A way to debug may be to PRINT * from your last table file and do the math by hand. Sometime is when we're doing it according to the logic we think we've putted in place that we found our issue...


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2410 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Silver Member
posted Hide Post
HCSRVOL is th master table. I am joining other 6 tables too, which I took out to make the code shorter so I can focus on the issue.


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 34 | Registered: December 17, 2012Report This Post
Platinum Member
posted Hide Post
quote:
COMPUTE CURPBCLAIMX/D8.2 = (CURCLMCNT / CURMRNCNT); AS ''


why don't you do the above COMPUTE in the previous TABLE.....
TABLE FILE HINV2
SUM 6WKCLMCNT AS 'CURCLMCNT'
6WKMRNCNT AS 'CURMRNCNT'
....COMPUTE in here.....


_______________________
*** WebFOCUS 8.1.05M ***
 
Posts: 196 | Location: London, UK | Registered: December 06, 2005Report This Post
Silver Member
posted Hide Post
I have total and grand total in 3 different level, user requested to get the total by recalculating for each level.


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 34 | Registered: December 17, 2012Report 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     [CLOSED] report code caluculation issue

Copyright © 1996-2020 Information Builders