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.

New TIBCO Community Coming Soon
In early summer, TIBCO plans to launch a new community—with a new user experience, enhanced search, and expanded capabilities for member engagement with answers and discussions! In advance of that, the current myibi community will be retired on April 30. We will continue to provide updates here on both the retirement of myibi and the new community launch.

What You Need to Know about Our New Community
We value the wealth of knowledge and engagement shared by community members and hope the new community will continue cultivating networking, knowledge sharing, and discussion.

During the transition period, from April 20th until the new community is launched this summer, myibi users should access the TIBCO WebFOCUS page to engage.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Issue with multiple IF clauses on the same column in multiple lines

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Issue with multiple IF clauses on the same column in multiple lines
 Login/Join
 
Platinum Member
posted
Hi,

I have come across an issue while testing our reports on WF v8.1.03. The following code represents the issue that we are facing

TABLE FILE CAR
PRINT *
IF COUNTRY IS '$*'
IF COUNTRY EQ 'JAPAN'
END

I expect the code to output results related to just 'JAPAN', even if have an IF condition before that gets all the data from the same field. Instead, i end up getting entire CAR table.

I see that WF8 is somehow ignoring the 2nd IF clause, after the 1st clause with '$*'. Is there a way to tell WF to consider both clauses. Because, we have similar code structure in many of our fex's, especially the use of $* and it is difficult to identify each one of them.

Note: The code runs perfectly in v7.6.11. We recently started migrating to v8.

Thanks in advance

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


WebFOCUS
7703/7705/8105m/8201m/8202m

 
Posts: 99 | Registered: September 10, 2013Report This Post
Expert
posted Hide Post
Not sure why you are using '$*', doesn't that just get all records ?

I would use WHERE instead and use and OR statement.

WHERE COUNTRY LIKE '%'
OR COUNTRY EQ 'JAPAN'


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6349 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Platinum Member
posted Hide Post
Waz,

Yep.. $* gets all records and i appreciate your suggestion. I only need records of 'JAPAN' alone using the same double IF statements.

I do accept that its a bad way of writing the conditions. But, the reason why i have posted the code in an unusual manner, is because we are in a hard position to make any changes to the 1st IF statement. Its all over the place. So, i am looking for an alternate solution.

By the way, the '$*' usually comes in the form of an & variable if the user does not select any value.

So, keeping the structure as i posted, can i make WF8 to consider both statements?... The code had no issues in v7.6.11.

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


WebFOCUS
7703/7705/8105m/8201m/8202m

 
Posts: 99 | Registered: September 10, 2013Report This Post
Gold member
posted Hide Post
Look for FOC_NONE if there is no value for your & variable
 
Posts: 90 | Location: Stuttgart | Registered: October 20, 2010Report This Post
Master
posted Hide Post
You need to write a search routine with lesser known commands like syscolum, etc., to find every instance of '$*'.

This would enable you to isolate each fex using '$*' so you change them accordingly.

Good luck


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Silver Member
posted Hide Post
What happens if you add a semicolon to the end of each of the IF statements?


8009
Windows, HTML, AHTML, Excel
In FOCUS since 1983
 
Posts: 41 | Location: Charlotte, NC | Registered: January 06, 2012Report This Post
Platinum Member
posted Hide Post
Putting semicolon at the end of if statements does not work


Using FOC_NONE or _FOC_NULL works, but the issue would be searching for every occurrence of '$*' in all the fex's.

I tried the second condition with CONTAINS and it seem to work.

The other thing is, this kind of issue occurs only on the indexed fields. Thats strange


WebFOCUS
7703/7705/8105m/8201m/8202m

 
Posts: 99 | Registered: September 10, 2013Report This Post
Guru
posted Hide Post
I just tried it and it worked fine


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
 
Posts: 398 | Registered: February 04, 2008Report This Post
Platinum Member
posted Hide Post
On which version have you tried?... I had the issue when i run on v8


WebFOCUS
7703/7705/8105m/8201m/8202m

 
Posts: 99 | Registered: September 10, 2013Report This Post
Guru
posted Hide Post
Aha, I am on 7.6.11


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
 
Posts: 398 | Registered: February 04, 2008Report This Post
Platinum Member
posted Hide Post
Yep.. It worked for us when we were in 7.6.11 too. I guess you are with me then. Smiler


WebFOCUS
7703/7705/8105m/8201m/8202m

 
Posts: 99 | Registered: September 10, 2013Report This Post
Guru
posted Hide Post
quote:
TABLE FILE CARPRINT *IF COUNTRY IS '$*'IF COUNTRY EQ 'JAPAN'END

Did you try using a WHERE instead of the second IF ?


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
 
Posts: 398 | Registered: February 04, 2008Report This Post
Platinum Member
posted Hide Post
yes... it didn't work


WebFOCUS
7703/7705/8105m/8201m/8202m

 
Posts: 99 | Registered: September 10, 2013Report This Post
Master
posted Hide Post
WF1326,

I am running wf V8008 and I had no issues with your example. I tried it with the car file and with one of my oracle tables. Can you run a SQL trace on your query? maybe something isn't translating correctly. Its possible depending on your query that things aren't translating to SQL correctly. Unfortunately I can't recreate it, so I can't run the trace.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
 
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013Report This Post
Virtuoso
posted Hide Post
No problem with V.8.0.0.7.
Maybe a downgrade is the solution?... Big Grin


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
Platinum Member
posted Hide Post
None of my options worked. I opened a case with ibi.


WebFOCUS
7703/7705/8105m/8201m/8202m

 
Posts: 99 | Registered: September 10, 2013Report This Post
Platinum Member
posted Hide Post
IBI came up with a solution

SET AUTOINDEX=OFF

My code works now Smiler


WebFOCUS
7703/7705/8105m/8201m/8202m

 
Posts: 99 | Registered: September 10, 2013Report This Post
Expert
posted Hide Post
It intrigues me as to how not using indexes makes it work.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6349 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report 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 multiple IF clauses on the same column in multiple lines

Copyright © 1996-2020 Information Builders