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]"New Expression" Option in IA+

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]"New Expression" Option in IA+
 Login/Join
 
Member
posted
In InfoAssist+, the Filters dialog box has an option, "New Expression" next to the option to create a new filter. I have tried to input an if-then statement under that option but an error comes up saying it doesn't recognize the word, "THEN". How can this be solved?

This message has been edited. Last edited by: ecsuappdevstu2,
 
Posts: 6 | Registered: October 23, 2018Report This Post
Virtuoso
posted Hide Post
Give us what you wrote, please.

When adding a post, you should always try to provide the code where you can so we can help you better. When creating the post, there are buttons above where you type out the post. Choose the
</>
button at the very end and put your code you're sharing therein for us.

Thanks!

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


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Member
posted Hide Post
IF &COAS EQ '1' THEN FGBOPAL.FGBOPAL.FGBOPAL_FUND_CODE EQ '916209' ELSE IF &COAS EQ '5' THEN FGBOPAL.FGBOPAL.FGBOPAL_FUND_CODE EQ 'X94000' 


My apologies. The code above is what I wrote that prompted the error message.
 
Posts: 6 | Registered: October 23, 2018Report This Post
Virtuoso
posted Hide Post
So, you need to walk through that statement in your head I think. You've got incomplete thoughts going on there.

It should read as follows:

IF &value EQ 1 THEN resultValue ELSE IF &value EQ 5 THEN resultValue;

Since you are actually trying to decode something, I'd use a DECODE statement instead/in conjunction with the DEFINE you're trying to write. Look that up in the docs to see how it works.


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Virtuoso
posted Hide Post
In WebFOCUS EQ is used for comparison not to populate values. I'm not sure what you're trying to create but you ought to take a look at IF THEN ELSE syntax in the manual under DEFINE to get a feel for what that should look like.

https://webfocusinfocenter.inf...ang/source/exp89.htm


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Member
posted Hide Post
What I'm trying to do is have one set of fund codes appear on a report if the &COAS (chart of accounts) is 1 and a different set of fund codes appear if the &COAS is 5. I think this may be a better example.
 WHERE IF &COAS EQ '1' THEN  FGBOPAL.FGBOPAL.FGBOPAL_FUND_CODE EQ '$$1$$$' ELSE IF FGBOPAL.FGBOPAL.FGBOPAL_FUND_CODE EQ '$$2$$$' ELSE 'NA'

The main question I'm asking is: can if-then statements be coded in the "New Expression" option?


WebFOCUS 8.2, Windows 10
 
Posts: 6 | Registered: October 23, 2018Report This Post
Virtuoso
posted Hide Post
The expression in Filter will always have a WHERE appended to it. From what you're saying, you really need to define a new field based on the logic you're showing.

COA/A2=IF &COAS EQ '1' THEN EDIT(FGBOPAL.FGBOPAL.FGBOPAL_FUND_CODE,'$$1$$$') ELSE 
       IF &COAS EQ '5' THEN EDIT(FGBOPAL.FGBOPAL.FGBOPAL_FUND_CODE,'$$2$$$') ELSE 'NA'

  

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


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Virtuoso
posted Hide Post
Maybe use something like the following:

WHERE FGBOPAL_FUND_CODE LIKE '$$1$$$';

OR

WHERE FGBOPAL_FUND_CODE LIKE '$$2$$$';

See here for more info on LIKE and CONTAINS.


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Virtuoso
posted Hide Post
CoolGuy: The problem is they have to check for 1 or 5 in &COAS to determine what they want to filter on.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Virtuoso
posted Hide Post
Yeah, didn't add that in. My bad. Kind of tricky, eh? lol Where's Francis or Waz when you need em? Wink

Also, BabakNYC, doesn't your solution replace all existing values to contain either a 1 or 2 in them? Not merely select those specific values from the records? He wants to show existing values not modify existing values.

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


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Virtuoso
posted Hide Post
In my example, I’m trying to show the difference between EQ and = as well as how you use IF THEN ELSE.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Member
posted Hide Post
 WHERE ( FGBOPAL.FGBOPAL.FGBOPAL_COAS_CODE EQ '1' AND FGBOPAL.FGBOPAL.FGBOPAL_FUND_CODE EQ '111000') OR ( FGBOPAL.FGBOPAL.FGBOPAL_COAS_CODE EQ '5' AND FGBOPAL.FGBOPAL.FGBOPAL_FUND_CODE EQ 'X12000'); 


I tried this code above and it worked.


WebFOCUS 8.2, Windows 10
 
Posts: 6 | Registered: October 23, 2018Report This Post
Virtuoso
posted Hide Post
Sweet man! Glad you got it working. Smiler


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report 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]"New Expression" Option in IA+

Copyright © 1996-2020 Information Builders