Can we make designer query choose joins based on condition?

Hello Everyone,

I am trying to resolve a logical issue in the designer. Basically we have few tables and two query paths. I was wondering if Business Objects Universe were able to take care of this by some means. It would be more clear if I explain with some examples.

Example:
Lets say we have some tables with the following fields.

And following is what I want

If tools. dpmt_flag = ‘0’ then do join site.tool_id = tool.tool_id
Otherwise if tools. dpmt_flag = ‘1’ then do join site.dpmt_id = department.dpmt_id AND department.tool_id = tool.tool_id

So summarizing it - based on the value of “dpmt_flag” in TOOLS table, if true then bring in the DEPARTMENT table in the query else leave it out.

Is it possible to resolve some thing like this using a designer.

Any ideas, suggestions or recommendations would be greatly appreciated.

Thanks in advance


edyl (BOB member since 2005-10-03)

yes, it possible. I will have to dig in to my previous posts and see but I remember doing it


Bo_Bhai :us: (BOB member since 2003-07-11)

Hello BO_Bhai,

I tried to do a author search on your userid but i must admit that the result i got back was quite overwhelming. Would you please point me to the right discussion. I would much appreciate it.

Thanks


edyl (BOB member since 2005-10-03)

According to BO_Bhai, looks like this can be done. Do we need to do something with the contexts? Can any one please point me towards documentations if any or give some pointers.

Your help would be much appreciated.

Thanks


edyl (BOB member since 2005-10-03)

It might be better to create a derived table

select
site_id, dpmt_id, tool_id
from SITE
union
select
-1, dpmt_id, tool_id
from DEPARTMENT