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.
DEFINE FILE RCRAPP1
ASSETS_IND/I1=
IF RCRAPP1_AIDY_CODE EQ '&AID_YEAR' AND ((RCRAPP1_PAR_CASH_AMT + RCRAPP1_CASH_AMT + RCRAPP4_PAR_INV_NET_WORTH
+ RCRAPP4_INV_NET_WORTH + RCRAPP4_PAR_BUS_NET_WORTH + RCRAPP4_BUS_NET_WORTH) LT 100000) THEN 1
ELSE 0;
END
PROBLEM: if the values for any of the fields (e.g. RCRAPP1_PAR_CASH_AMT) in the summation is null, then the end result is always a 0 and never a 1.
Is there a function that I can use with these fields that will return a zero value when it pulls the field instead of a null value?
I know that I can create a single define for each field (e.g. RCRAPP1_PAR_CASH_AMT) that i use in other defines, but I was hoping for a more efficient way of doing this.
What you could do is to first collect all needed fields and store them in a hold file using the holdmiss=off setting. Next you can do your defines against this hold file where now all fields are by definition not-missing and filled with 0 iso null.
Hope this helps ...
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
DEFINE FILE RCRAPP1 ASSETS_IND/I1= IF RCRAPP1_AIDY_CODE EQ '&AID_YEAR' AND ((RCRAPP1_PAR_CASH_AMT + RCRAPP1_CASH_AMT + RCRAPP4_PAR_INV_NET_WORTH + RCRAPP4_INV_NET_WORTH + RCRAPP4_PAR_BUS_NET_WORTH + RCRAPP4_BUS_NET_WORTH) LT 100000) THEN 1 ELSE 0; END
Problem is in rdbms (stupidity**stupidity)
Value + null = null (something add nothing is nothing)
In wf (sensible option)
Value + null = Value (something add nothing is something)
The problem you have is that the calc is passed to the rdbms and done there.
To prevent this
DEFINE FILE RCRAPP1
ASSETS_IND/I1= IF EDIT('A','9') EQ 'B' THEN -1
ELSE IF RCRAPP1_AIDY_CODE EQ '&AID_YEAR' AND ((RCRAPP1_PAR_CASH_AMT + RCRAPP1_CASH_AMT + RCRAPP4_PAR_INV_NET_WORTH
+ RCRAPP4_INV_NET_WORTH + RCRAPP4_PAR_BUS_NET_WORTH + RCRAPP4_BUS_NET_WORTH) LT 100000) THEN 1
ELSE 0;
END
The IF EDIT('A','9') EQ 'B' THEN -1 is there to purely disable optimization since it uses a wf function EDIT. It will never be executed and the result of the expression still applies.
However the result will be calculated by wf and not the rdbms and thus will give you the correct result you desire!
We are waiting for SQL to catch up with wf!
Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006