Focal Point
[SOLVED] Focus commands Order of precedence

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

April 07, 2011, 04:55 PM
TryFocus
[SOLVED] Focus commands Order of precedence
Trying to filter a JOIN based on a DEFINE field created earlier.

Is there an Order of precedence in which FOCUS commands are executed by WFRS?

Below code throughs Error message. Can anybody suggest what's wrong with below code?

  
DEFINE FILE CAR
profit/D12.2=CAR.BODY.RETAIL_COST - CAR.BODY.DEALER_COST;
END
JOIN
FILE CAR AT CAR.ORIGIN.COUNTRY 
TO MULTIPLE 
FILE CAR AT CAR.ORIGIN.COUNTRY TAG J0 AS J0
-*
WHERE J0.ORIGIN.COUNTRY EQ J0.ORIGIN.COUNTRY;
WHERE J0.BODY.profit GT 5000;
END


Thanks
TryFocus

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


Prod: WF 7.6.10 windows. -- MRE/Dashboard/Self Service/ReportCaster - Windows XP
April 07, 2011, 05:52 PM
Waz
Basics...

You should always issue your join prior to your define.

Also, I am not sure you can reference a defined field in a conditional join.

What is the error message ?


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!

April 08, 2011, 05:10 PM
TryFocus
Thanks Waz. I was trying to implement this sort of logic using InfoAssist GUI. Can you suggest any work around to implement this as we are trying to achieve MATCH functionality.

Thanks
TryFocus.


Prod: WF 7.6.10 windows. -- MRE/Dashboard/Self Service/ReportCaster - Windows XP
April 10, 2011, 05:50 PM
Waz
MATCH functionality is quite broad, what were you after exactly ?


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!

April 10, 2011, 11:38 PM
TryFocus
Was trying to implement Above Posted code using InfoAssist GUI (No Editor).

(OR)

This Scenario in InfoAssist:
1. Couple of Defines on Table_1
2. Joining Table_1 to Table_2 on Real fields.
3. Join Filter condition on DEFINES based on Table_1.

Thanks


Prod: WF 7.6.10 windows. -- MRE/Dashboard/Self Service/ReportCaster - Windows XP
April 11, 2011, 05:59 AM
<FreSte>
Below you'll find The-12-Steps-Of-Table:

1.	WHERE's
2.	DEFINE's
3.	WHERE on DEFINE's
4.	SORT
5.	VERB (=PRINT or SUM)
6.	PREFIX OPERATORS (FST. LST. MAX. etc)
  	… internal matrix is ready at this point …
7.	COMPUTES
8.	WHERE TOTAL
9.	BY TOTAL
10.	GENERATE TOTALS / SUBTOTALS etc.
11.	RECAP's (based on subtotals)
12.	STYLING + OUTPUT

In general:
	WebFOCUS will offload as much as possible to the RDBMS
	If 1 step cannot be offloaded to the RDBMS
		that step will be solved by WebFOCUS
		all following steps from that point will be solved by WebFOCUS
	All steps after generating the Internal Matrix are always solved by WebFOCUS

April 11, 2011, 09:03 AM
Waz
quote:
The-12-Steps-Of-Table


Isn't this part of the training ?


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!

April 11, 2011, 10:30 AM
GaryB
I think you could fix the original join with the KEEPDEFINES = ON setting

Gary

quote:

KEEPDEFINES = ON
DEFINE FILE CAR
profit/D12.2=CAR.BODY.RETAIL_COST - CAR.BODY.DEALER_COST;
END
JOIN
FILE CAR AT CAR.ORIGIN.COUNTRY
TO MULTIPLE
FILE CAR AT CAR.ORIGIN.COUNTRY TAG J0 AS J0
-*
WHERE J0.ORIGIN.COUNTRY EQ J0.ORIGIN.COUNTRY;
WHERE J0.BODY.profit GT 5000;
END

April 11, 2011, 11:18 AM
ABT
quote:
Originally posted by Waz:
quote:
The-12-Steps-Of-Table


Isn't this part of the training ?


I knew Focus was associated with a 12 step program.... That actually explains a lot.

- ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
April 11, 2011, 05:39 PM
Waz
Some times there is step 13.




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!

April 11, 2011, 07:37 PM
Jim Morrow
If I remember correctly "Step 13" involves an alcoholic beverage Smiler


Jim Morrow
Web Focus 7.6.10 under Windows 2003
MVS 7.3.3



April 13, 2011, 11:56 AM
GaryB
By the way, the DEFINE for a conditional join must go first.