Focal Point
Stumped by defines!

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

July 27, 2004, 03:47 PM
<elina>
Stumped by defines!
Hi, all -

I'm very new to this WebFOCUS business and I'm trying to do something that may not even make sense. Maybe somebody can clue me in.

I'm using the report painter. In my project I have a define for a field in one table. This is followed by a four-way join based on the same table. In the join view I can see the defined field, however when I open a report the defined field is not in the list.

Should I be creating a HOLD file before I make my join? Where am I going wrong?

Thanks for your help!
July 27, 2004, 07:27 PM
Jen
Hi Elina,

What you're trying to do makes total sense! Did you run your join before opening the Report Painter? That's the only thing I can think of, especially since you see the defined field in the Join view.
July 27, 2004, 07:34 PM
Chris Boylan
JOIN clears DEFINEs so you need to make sure that the DEFINE is executed AFTER the JOIN (which always seemed strange to me... particularly with DEFINE-based JOINs). Run the JOIN first, then the DEFINE and then you should see the defined field in the painter

You can also place the DEFINE in the Master File Description to avoid this problem.

Hope that helps...

-Chris
July 27, 2004, 07:35 PM
<kj>
The JOIN command clears all defined fields.
To preserve the virtual fields after join, you need to set the KEEPDEFINES SET command on.
Place it before you define virtual fields.

SET KEEPDEFINES = ON

Thanks,
kj
July 28, 2004, 03:39 PM
<elina>
Thanks for your help, guys! At least now I know how the defines work with joins.

quote:
Originally posted by kj:
[qb] The JOIN command clears all defined fields.
To preserve the virtual fields after join, you need to set the KEEPDEFINES SET command on.
Place it before you define virtual fields.

SET KEEPDEFINES = ON

Thanks,
kj [/qb]
Thanks, kj. I put in the SET as you suggested and it allows the defined field to stay in the list. Unfortunately there's another problem now which breaks my report, but I don't think it has anything to do with the join. My defined field references two fields from two different tables but after the join the defined field is not listed at the bottom of the join but inside one of the tables. What could I do to fix that?

Thanks again!
September 17, 2004, 04:52 PM
webfocuspgm
My issue is something like this one only I need to create a "reporting object" joining two tables on a field that is a different size in each table.

How do you create a defined base join for a reporting object in MRE ..... I'm not using Report Painter...... Is it possible...?

Thanks
November 05, 2004, 05:37 PM
<Emma Schwarz>
When you're creating a Reporting Object, the JOIN component is created before the DEFINE component, so you can't use an inline DEFINE. It sounds like you're better off using a DEFINE in the Master. You need to put the DEFINE in the Master file you're JOINing FROM (the first Master in the JOIN statement, and the one you specified when you created the Reporting Object).

Hope this helps.
Emma