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     [SOLVED] WF NOT considering first part of IF loop

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] WF NOT considering first part of IF loop
 Login/Join
 
Member
posted
Hi,

The Issue i am experiencing when exporting data to excel is the IF loop in compute statement Not working as expected...

Please see the code...

DEFINE FILE HLD_NST
DUMMYAMT/I5='';
END
TABLE FILE HLD_NST
PRINT
'HLD_NST.HLD_NST.AREA_CODE' AS 'GL CODE'
'HLD_NST.HLD_NST.CURRENCY' AS 'CURRENCY'
'HLD_NST.HLD_NST.SHORT_CODE' AS 'NOSTRO'
'J1.HLD_LDG.CLOSING_BALANCE' AS 'CLOSING WSS BALANCE'
'J0.HLD_BB.AMT' AS 'CLOSING BANK BALANCE'
COMPUTE ABSDIFF/D20.2 MISSING ON NEEDS SOME DATA = IF (J0.HLD_BB.AMT EQ '') THEN DUMMYAMT ELSE IF (J1.HLD_LDG.CLOSING_BALANCE EQ '') THEN DUMMYAMT ELSE J0.HLD_BB.AMT - J1.HLD_LDG.CLOSING_BALANCE;
AS 'DIFFERENCE'
COMPUTE CONDDIFF/A20V = IF J0.HLD_BB.AMT EQ '' OR J1.HLD_LDG.CLOSING_BALANCE EQ '' THEN 'NR' ELSE '';
AS ' NOT REPORTED'
BY TOTAL HIGHEST COMPUTE DIFF/D20.2 = IF J0.HLD_BB.AMT EQ '' OR J1.HLD_LDG.CLOSING_BALANCE EQ '' THEN 0.0 ELSE IF ABS(J0.HLD_BB.AMT - J1.HLD_LDG.CLOSING_BALANCE) EQ 0 THEN 0.0001 ELSE ABS(J0.HLD_BB.AMT - J1.HLD_LDG.CLOSING_BALANCE + 1); NOPRINT

--------------------------
Here in ABSDIFF/D20.2 ideally i need to display '' when either if J0.HLD_BB.AMT EQ '' or J1.HLD_LDG.CLOSING_BALANCE EQ '' else calculate the difference...

I tried with
J0.HLD_BB.AMT EQ '' or J1.HLD_LDG.CLOSING_BALANCE EQ '' then DUMMYAMT else J0.HLD_BB.AMT - J1.HLD_LDG.CLOSING_BALANCE ...But that gives me .00 as the o/p if first condition..so i modified with the above code...

Then Now what happens is the second condition works fine(ELSE IF (J1.HLD_LDG.CLOSING_BALANCE EQ '') THEN DUMMYAMT works fine but not the first condition..so if the first if has '' it gives me o/p as .00...

if i interchage the data loop with first condition as J1.HLD_LDG.CLOSING_BALANCE EQ '' then it will have .00 and J0.HLD_BB.AMT EQ '' works fine...

This message has been edited. Last edited by: Kerry,


WebFOCUS 76
Windows
all formats
 
Posts: 18 | Registered: September 14, 2009Report This Post
Expert
posted Hide Post
Well, first of all, in your define you are equating a numeric field to alpha ticks. You should probably be setting it to zero or missing. Then in your computes, you are comparing a numeric field to ticks when it should probably be zero or MISSING. You should probably do some reading on MISSING with virtual fields.

Another way to test is to create separate computes for each of your conditions and turn it to a one if it passes and a zero if it does not. That will give you a better idea of where the problem is to allow you to fix the original compute so that it works the way you want it to.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Member
posted Hide Post
Thanks a lot Ginny...

With Missing and ALL it works perfect....


WebFOCUS 76
Windows
all formats
 
Posts: 18 | Registered: September 14, 2009Report 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     [SOLVED] WF NOT considering first part of IF loop

Copyright © 1996-2020 Information Builders