BusinessObjects Board

Union with derived table

I want to make a derived table with a query to achieve something like this -

Select A.date,A.order,A.name from A where A.date = @prompt(‘enter date’…)
union
Select B.date,B.order,B.name from B where B.order = A.order (orders fetched from table A for the input A.date, and not for the same date)

The issue is, I just cannot make a view on the database with a union as well -

Select A.date,A.order,A.name from A
union
Select B.date,B.order,B.name from B

because if I create a ‘condition object’ over this view for say a date, then it would apply a filter on the entire view, which I do not want.

Can you please guide me towards the approach I should follow for this? Can I use cascaded prompts in this case? If yes, then how?

Thank you.


MJ8118 (BOB member since 2006-10-05)

Looks like a Derived table (as you said) is a good idea! :slight_smile: Any problem with creating a Derived table?


nithya_raj (BOB member since 2007-02-03)

No no problems creating a derived table, but I had a different issue, it is to do with the the prompts and how to pass the values entered in one prompt of a table used and pass it on to other table, if you have a look at my first post you should get a fair idea.

Any help would be appreciated.


MJ8118 (BOB member since 2006-10-05)

Ah ok. :roll_eyes:

Cant you create a Derived table for that with a sub query like…

Select B.date,B.order,B.name from B 
where B.order in (Select A.order from A where A.date = @prompt('enter date'...) ) 

nithya_raj (BOB member since 2007-02-03)

Thank you.
You are correct, this can be acheived through derived table, with a query something like this :

Select B.date,B.order,B.name from B
where B.order in (Select A.order from A where A.date = @prompt(‘enter date’…) )
UNION
Select A.order from A where A.date = @prompt(‘enter date’…)

Now this leads to the other requirement that user has, he doesn’t want this prompt (@prompt(‘enter date’…) )
) compulsarily i.e. he wants a seperate ‘condition object’ in the universe which he can select and based on the date he enters it should fetch the information from table A and then select the information for the orders corresponding to the input date from table B ?

In the above approach the prompts are built within the derived table, so it doesn’t give the user with the option.

Any assistance would be appreciated.

Thanks a lot.


MJ8118 (BOB member since 2006-10-05)

Any assistance on this, please?


MJ8118 (BOB member since 2006-10-05)

The user wants to enter a date and still does not want to see a prompt? I actually don’t get the issue… :crazy_face:


nithya_raj (BOB member since 2007-02-03)

By that I meant, the user wants to see a prompt, but he wants to choose the prompt whenever he needs it, so for that he wants a condition object (a predefined filter at the universe level), on choosing this filter it would prompt the user to ‘enter date’, and based on this date further processing would happen, as explained in my previous post.

So we do not want the '@prompt(‘enter date’…) ’ in the derived table query, instead have it seperately as a condition object.

I hope am clearer this time?

Thanks a lot for your time.
[/quote]


MJ8118 (BOB member since 2006-10-05)

I can only think of workarounds… :roll_eyes:

  1. Change your ETL process such that you will not have to come up with the Derived tables in the first place - probably have an aggregate table or a view with the required data.
  2. Provide a prompt to the User, but he will have the option of choosing ALL or a value for the filter. Check the FAQ FAQ: Designer for details.

nithya_raj (BOB member since 2007-02-03)

Thanks for all your help.
Will explore the options I have got.


MJ8118 (BOB member since 2006-10-05)