Focal Point
[CLOSED] CONDITIONAL JOIN -

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

December 03, 2018, 03:32 PM
Siva1925
[CLOSED] CONDITIONAL JOIN -
Hi,
I am using a conditional join with variable and constructing a cluster masterfile.
JOIN WHERE CAR EQ &&CAR.
How can I pass FOC_NULL to this variable.If I use FOC_NULL it throws me error.

This message has been edited. Last edited by: FP Mod Chuck,
December 03, 2018, 09:03 PM
BabakNYC
Isn’t it _FOC_NULL? What’s the error?


WebFOCUS 8206, Unix, Windows
December 04, 2018, 11:52 AM
Siva1925
(FOC32516) AN ELEMENT IN JOIN_WHERE EXPRESSION IS NOT RECOGNIZED: _FOC_NULL
BYPASSING TO END OF COMMAND
December 04, 2018, 12:24 PM
BabakNYC
Can you share an example we could run? WF_Retail has FACTS and DIMENSIONS you can use to join SALES to PRODUCT.


WebFOCUS 8206, Unix, Windows
December 04, 2018, 12:32 PM
Siva1925
I don't have the WF_Retail sample in my Repository
December 05, 2018, 12:13 PM
Siva1925
Hi,
Is there any way to do this.
How can we ignore the JOIN WHERE condition in run time.
December 06, 2018, 11:00 AM
jgelona
It is really pretty simple. You have a conditional statement which implies sometimes you want it and other times you don't.

Just set the line to an & variable, sort of like this:

-SET &CJLINE=IF condition is true THEN 'YOUR LINE OF CODE' ELSE '-*';


then where your line of code is, just substitute it with &CJLINE like this:

... lines of code
&CJLINE
... more lines of code


When you want it, it will be there otherwise it will be a -* which the parse will ignore.

Also, why do you have 2 threads open for this question?


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
December 06, 2018, 03:17 PM
Siva1925
I can comment the line if I have it in the procedure.What I have is a cluster master file where I am joining two tables.In that one JOIN condition has &&Variable and the other is Table1_ID EQ Table2_ID.
The JOIN condition will be JOIN WHERE Enrollment Date GE &&VARIABLE.

If I pass a value to this variable it will work fine.
What if I need to ignore this condition and run it for only the join condition with the ID.
December 07, 2018, 09:45 AM
jgelona
Have you looked into using a master file profile?


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
December 11, 2018, 04:39 PM
Siva1925
quote:
master file profile

I have not used MFD profiles much in my development.
It would be helpful if you can share how we can use MFD profiles to achieve this requirement.
December 11, 2018, 05:37 PM
FP Mod Chuck
Siva

An MFD Profile is just another fex you register with the master file. When you open the synonym in the properties there is a place to reference the fex to be used under MFD_PROFILE. It can set && variables every time a user accesses the master file.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
December 12, 2018, 11:05 AM
Siva1925
Hi Chuck,
I am setting my variable in the procedure.But if i set it as _FOC_NULL it throws error.
December 12, 2018, 11:09 AM
FP Mod Chuck
Siva

Better open a case with techsupport I don't know why that would cause an error. Did you put it inside single quote marks?


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
December 12, 2018, 03:48 PM
j.gross
The functionality of _FOC_NULL, to signal "ignore this line of code" only works in a fex (as the fex pre-processor is determining whether and in what form to push the line into Focstack for execution).

In code occurring in an MFD and referencing global (&&) variables, if the &&var's value is _FOC_NULL it will be taken literally -- if within quotes, as a text value; if unquoted, as a fieldname. Either way, the resolved line remains "active" and the Join will throw an error at run-time.