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] Issue with IF Condition

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved] Issue with IF Condition
 Login/Join
 
Member
posted
Hi ,

i have an issue with the below statements. In the below IF condition even if CMM1 value is greater then MONTH2 it is executing the statements just after IF statement, instead of skipping to X081 para as per the condition.

Let me know if there is any issue with IF condition and the related GOTO statements. I referred the focus documentation but didn't find any tip

Any solution most welcome...

CMM1/I2=EDIT(CMM);
YEAR2/I4=EDIT(YEAR1);
MONTH2/I2=EDIT(MONTH);
YEAR2=CYR2-YEAR2;
-IF CMM1 GT MONTH2 THEN GOTO X081;
MONTH2=12-MONTH2;
MONTH2=CMM1+MONTH2;
YEAR2=YEAR2-1;
-GOTO X082;
-X081
MONTH2=MONTH2-CMM1;
-X082;
YR1/A4=EDIT(YEAR2);

This message has been edited. Last edited by: Kathleen Butler,


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 9 | Registered: August 19, 2011Report This Post
Virtuoso
posted Hide Post
That looks like a mix of a DEFINE block and dialog manager code. DM can't read field values like that.

Basically what you're testing for is whether the string 'CMM1' is greater than the string 'MONTH2', and it isn't - 'C' comes before 'M'.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Platinum Member
posted Hide Post
Hi,

All you need would de using if...then...else in a DEFINE/COMPUTE field to manupulate the values based on certain condition...

DEFINE FILE FN
VAL1/A10= IF VAL2 GT VAL3 THEN 'ABC' ELSE 'XYZ';
END



thanks
Sashanka


WF 7.7.03/Windows/HTML,PDF,EXL
POC/local Dev Studio 7.7.03 & 7.6.11
 
Posts: 103 | Registered: June 12, 2009Report This Post
Member
posted Hide Post
actually my need is

1) If value of CMM1 field is greater than value of MONTH2 value, i need to perform below computations

MONTH2 = 12 - MONTH2;
MONTH2 = CMM1 + MONTH2;
YEAR2 = YEAR2 - 1;

2) If value of CMM1 field is less than value of MONTH2 value, I need to perform

MONTH2 = MONTH2 - CMM1;

How can this accomplished using focus statements.

The earlier response mail suggested to go with below code. But please note that in the above 1st check - If value of CMM1 field is greater than value of MONTH2 value, i have to perform 3 different computations. how can this done using single IF Condition....

DEFINE FILE FN
VAL1/A10= IF VAL2 GT VAL3 THEN 'ABC' ELSE 'XYZ';
END


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 9 | Registered: August 19, 2011Report This Post
Virtuoso
posted Hide Post
I suggest the following:
  
CMM1/I2=EDIT(CMM); 
YEAR2/I4=EDIT(YEAR1); 
MONTH2/I2=EDIT(MONTH); 
YEAR2=CYR2-YEAR2; 
MONTH2S/I2=MONTH2;
MONTH2=IF CMM1 GT MONTH2S THEN CMM1+ 12-MONTH2 ELSE MONTH2-CMM1;
YEAR2=IF CMM1 GT MONTH2S THEN YEAR2-1 ELSE YEAR2;
YR1/A4=EDIT(YEAR2);


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Member
posted Hide Post
solved Smiler


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 9 | Registered: August 19, 2011Report 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] Issue with IF Condition

Copyright © 1996-2020 Information Builders