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.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Filtering records through hold file

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Filtering records through hold file
 Login/Join
 
Gold member
posted
Hi,

I have a requirement where in from my database , the records will be like below :

Plan_Code Rxr Bin ActDetails Eff_Dt
------------------------------------------------
Plan2 LPN 111 Expired 2009/10/14
Plan2 LPN 111 Expired 2009/10/14
Plan2 LPN 222 Expired 2009/10/15
Plan2 MNB 281 Expired 2009/10/14
Plan2 MNB 282 Active 2009/10/14
Plan2 MNB 282 Active 2009/10/15



The unique is Plan_Code and Rxr.So

1)if this set contains ActDetails both 'Active' and Expired then in that set if anything is expired , the BIN corresponding to Active should be displayed for the expired records
2)If in a set all are expired , then i need to take the MAX(eff_date) and the corresponding BIN needs to get dispalyed for that set.

The output should look like below:



Plan_Code Rxr Bin ActDetails Eff_Dt
------------------------------------------------
Plan2 LPN 222 Expired 2009/10/14
Plan2 LPN 222 Expired 2009/10/14
Plan2 LPN 222 Expired 2009/10/15
Plan2 MNB 282 Expired 2009/10/14
Plan2 MNB 282 Active 2009/10/14
Plan2 MNB 282 Active 2009/10/15

Please find the code below .


 
TABLE FILE SQLOUT
PRINT
*
ON TABLE HOLD AS HLD_PRC
END

TABLE FILE HLD_PRC
SUM
FST.Bin AS BIN1
BY Plan_Code
BY Rxr
WHERE ActivePlnDet EQ 'Active'
ON TABLE HOLD AS HLD1
END

TABLE FILE HLD_PRC
SUM
MAX.PlnEffDt
Bin AS BIN2
BY Plan_Code
BY Rxr
WHERE ActivePlnDet EQ 'Expired'
ON TABLE HOLD AS HLD2
END


JOIN CLEAR *
JOIN Plan_Code AND Rxr IN HLD_PRC TO Plan_Code AND Rxr IN HLD1 AS JJ2
JOIN Plan_Code AND Rxr IN HLD_PRC TO Plan_Code AND Rxr IN HLD2 AS JJ3


TABLE FILE HLD_PRC
PRINT
*
END


DEFINE FILE HLD_PRC
Fin_Bin/A6 = IF ActivePlnDet EQ 'Expired' THEN BIN1 ELSE BIN2;
END



TABLE FILE HLD_PRC
PRINT
MANG_CARE_PLN_I
Plan_Name AS 'Plan Name'
Plan_Code AS 'Plan Code'
Fin_Bin AS 'BIN'
ActivePlnDet
Prcs AS 'PCN'
GroupId AS 'Group ID'
END



With the above code ,

my output gets displayed like below :


Plan_Code Rxr Bin ActDetails Eff_Dt
------------------------------------------------
Plan2 LPN Expired 2009/10/14
Plan2 LPN Expired 2009/10/14
Plan2 LPN Expired 2009/10/15
Plan2 MNB 282 Expired 2009/10/14
Plan2 MNB 282 Active 2009/10/14
Plan2 MNB 282 Active 2009/10/15

i.e Ponint 1) gets satisfied but not 2.

Appreciate your help as this is an urgent issue that needs to get resolved.

Thanks !

Janani


WebFOCUS 7.6.9
Windows
Excel, HTML, PDF
 
Posts: 71 | Registered: April 17, 2009Report This Post
Gold member
posted Hide Post
Any solution?

Thanks!
Janani


WebFOCUS 7.6.9
Windows
Excel, HTML, PDF
 
Posts: 71 | Registered: April 17, 2009Report This Post
Virtuoso
posted Hide Post
Something like this perhaps?
DEFINE FILE PLAN
CA/I4 = IF ACTDETAILS EQ 'Active' THEN 1 ELSE 0;
CI/I4 = IF ACTDETAILS NE 'Active' THEN 1 ELSE 0;
CT/I4 = 1;
ACTBIN/A4 = IF ACTDETAILS EQ 'Active' THEN BIN ELSE ACTBIN;
INACTBIN/A15 = EFF_DT | '-' | BIN;
END
TABLE FILE PLAN
SUM   CT CA CI MAX.ACTBIN MAX.INACTBIN
BY    PLAN_CODE BY RXR
PRINT *
BY    PLAN_CODE BY RXR
ON    TABLE HOLD
END

DEFINE FILE HOLD
INBIN/A4 = EDIT(INACTBIN,'$$$$$$$$$$$9999');
SHOWBIN/A4 = IF CA GT 0 AND CI GT 0 THEN ACTBIN ELSE
             IF CA EQ 0 THEN INBIN ELSE BIN;
END

TABLE FILE HOLD
PRINT PLAN_CODE
      RXR
      SHOWBIN
      ACTDETAIL
      EFF_DT
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     Filtering records through hold file

Copyright © 1996-2020 Information Builders