OBIEE Merge two queries (join)

泪湿孤枕 提交于 2020-01-16 19:30:09

问题


I need help.

I am new to obiee (recently moved from business objects and re-creating all reports in obiee).

Here is an example I need help with. I have created an analysis where I am listing all orders with their target delivery dates and number of products in each order.

Order Id......Target Delivery Date...No of products

Abc....1/1/2016.....5

I want to add to a column next to No of products called "No of prods delivered on time". I want to compare delivery date of each product within a order with the target delivery date and Give count of products delivered within the target date.. So the output should be

Abc....1/1/2016....5.....3

Where 3 is number of products delivered on time.

I could do it in BO by running two queries and merging them however in obiee I am not able to add second query to my analysis. I did try at product level using case when target date >=delivery date then 1 else 0 and wrapped this with sum function to aggregate but it didn't work ..

Appreciate your help in this. Searching for this topics give me results for running queries from multiple subject area :(


回答1:


You also have unions in OBIEE, you union the results of 2 queries which return the same structure, so you have query A with Order ID, Target Date, No Products and a Dummy column with a 0 and default agregation Sum, and a second query with Order ID, Target Date, Dummy column summing 0 and the number of products delivered. You do all this in the criteria tab of the analysis. It's important the order in which you put your columns, because that's what OBIEE is using to do the union. Regards



来源:https://stackoverflow.com/questions/36849535/obiee-merge-two-queries-join

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!