Focal Point
[SOLVED] Issue with multiple IF clauses on the same column in multiple lines

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1917049676

June 25, 2015, 04:57 PM
WF1326
[SOLVED] Issue with multiple IF clauses on the same column in multiple lines
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

June 25, 2015, 06:23 PM
Waz
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!

June 25, 2015, 08:43 PM
WF1326
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

June 26, 2015, 02:20 AM
MichaelBalle
Look for FOC_NONE if there is no value for your & variable
June 26, 2015, 07:49 AM
Tomsweb
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
June 26, 2015, 08:17 AM
Joni Campbell - Europa Sports
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
June 26, 2015, 10:05 AM
WF1326
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

June 26, 2015, 01:39 PM
RSquared
I just tried it and it worked fine


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
June 26, 2015, 03:20 PM
WF1326
On which version have you tried?... I had the issue when i run on v8


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

June 26, 2015, 04:06 PM
RSquared
Aha, I am on 7.6.11


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
June 26, 2015, 04:14 PM
WF1326
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

June 26, 2015, 04:26 PM
RSquared
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
June 26, 2015, 04:32 PM
WF1326
yes... it didn't work


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

June 26, 2015, 04:38 PM
eric.woerle
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
June 30, 2015, 01:15 AM
Danny-SRL
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

July 01, 2015, 08:32 AM
WF1326
None of my options worked. I opened a case with ibi.


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

July 07, 2015, 04:33 PM
WF1326
IBI came up with a solution

SET AUTOINDEX=OFF

My code works now Smiler


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

July 07, 2015, 06:00 PM
Waz
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!