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     How to Use where condition in a IF Statement ?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
How to Use where condition in a IF Statement ?
 Login/Join
 
Member
posted
Hi All,

I am new to this WebFocus, I dont know how to use either one WHERE condition from the IF statement.
Let me expalin below:
I am creating the report , which will drill down to 2 child reports. the lower level child will contain the detailed information.So when i drill down from 1st child to 2nd i am having fields with passing paramaters.In the 1st child report there are fields like F1,F2,F3,F4 etc..
If i click on the one of the rows in the report, it will pass the info to 2nd child report, while passing values, some of the fields like F3, or F4 will contain the NULL values, so that the 2nd child will not be executed, to do so i need to write a IF statement like
IF F3 EQ null then
(where condition like,, F1= '&F1' and F2='&F2' and F3=Null)
ELSE
(where condition like,, F1= '&F1' and F2='&F2' and F3='&F3')
END IF

But i dont know the Syntax. Please any one help me on this problem ?


WebFocus 7.6.4
windows XP
MS SQL 2000/2005
 
Posts: 13 | Registered: August 28, 2008Report This Post
Expert
posted Hide Post
Rekha,

First of all, please update your profile signature with your products, releases, and platforms so that we can better help you.

Second, please look up the syntax for IF and WHERE in the "Creating Reports with the WebFOCUS Language" manual which can be found by clicking on the documentation link in the upper righthand corner of this page.

Third, IF statements cannot be compound in the body of the report; they can only be compound on the righthand side of an equal sign in a define or compute. So I would suggest that you use WHERE to construct your screening conditions.

You might also want to search this forum and the documentation for FOC_NONE as this might help you with your problem.


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
Virtuoso
posted Hide Post
The received parameters are "dialog manager" variables (&F1 etc.). Dialog manager is a scripting language, with decision logic. It has ancient roots, and is GOTO- rather then block-oriented.

You can use D.M. to test the parameters and branch to appropriate reporting code:

-IF (&F3 EQ '') THEN GOTO CASE2
-ELSE
-IF (&F2 EQ '') THEN GOTO CASE3;

-CASE1
. . . appropriate code for case 1
-GOTO DONE
-CASE2
. . .
-GOTO DONE
-CASE3
. . .
-DONE

You get the idea?


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Gold member
posted Hide Post
actually you don't need to use the goto's. you could do it much simpler in DM this way

-SET &WHEREF1 = IF &F3 EQ '' THEN 'WHERE ....'
- ELSE IF F2 EQ '' THEN 'WHERE ....'
- ELSE ''

ETC.

then where you would normally put the where statement, call the variable
&WHEREF1.EVAL
  

When the FEX executes it will replace the amper statement with the appropriate where statement


Eric Woerle
WF 7.6.7 Reportting Server
ETL 7.6.10
Dev Studio 7.6.7
 
Posts: 95 | Registered: July 31, 2007Report This Post
Virtuoso
posted Hide Post
Hi Rekha

Lots of suggestion for this obvious simple question.
I can add some more ways to handle this and confuse you more and more.
What is DM?
What does Ginny mean by "body of the report"

What you really need to do is go to your manager and ask (maybe force) him to send you to one ore more basic trainings.

It will help you a lot and your questions and our helpful hints will be much more valuable.

Have a nice weekend...




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Expert
posted Hide Post
Frank, Yes. The Forum should be for more advanced topics, right? But, then again, new users will get a good basis / familiarity with the Forum and, thus, be beneficial to all in the long run, right?

I like your thinking Eric,
I would have only added two things. 1: the closing semi-colon and a '-* No Op notation' in the ELSE so that it would show up during a -SET &ECHO = ALL ;

-Doug




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Virtuoso
posted Hide Post
Rekha,

The first child needs parameters to do its thing. These parameters come from the parent procedure. Should not the second child also need the first child's parameters?
If yes, then just propagate them to the second child. You can do this by adding them to the parameter list of the drilldown command:
focexec=child2(f1=&f1.quotedstring f2=&f2.quotedstring f3=field3 ...etc)
The parameter list can be a mix of &values and report fields....


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Platinum Member
posted Hide Post
I would like to re-enforce doing this code with sets. First of all, using -SET is very compatable with the report painter because the prefix execution before the painter opens has no ambiguity.
Secondly there is the magic of FOC_NONE ... it allows lines to be thrown away at execution time. I regularly use a parm style that allows a user to say ALL which means I do not want a WHERE.
-DEFAULT PROD = ALL
..
-SET &WHPROD = IF &PROD EQ 'ALL' THEN 'FOC_NONE' ELSE &PROD ;
...
TABLE FILE ...
WHERE PRODUCT EQ '&WHPROD';
...
TYPE=DATA,COLUMN=..
FOCEXEC=child_fex(P1=N1 PROD=&PROD.QUOTEDSTRING ...)

This allows the system to throw away the WHERE statement, but pass PROD='ALL' in the drilldown. And this style works fine with devstudio report painter.


Brian Suter
VP WebFOCUS Product Development
 
Posts: 200 | Location: NYC | Registered: January 02, 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     How to Use where condition in a IF Statement ?

Copyright © 1996-2020 Information Builders