on 10-13-2011 9:55 PM
Hi Gurus,
I have a derived table in my old universe and the deski is pointing the old one. Now we are creating a brand webi report exactly similar to deski but the new webi will point to new universes.
I need to bring objects from base tables and here is my code
Code:
(select distinct Placement, Position as origin
from Epict.Placementdetail where Placetype = 'LOAD') Plctmnt1,
(select distinct placement, position as destination
from Epict.Placementdetail where placetype = 'DISCHARGE') plctmnt2
where
Plctmnt1.placement = plctmnt2.placement) DERIVED_PLACEMENT_LOCATION
I need to bring Origin and Destination from the code and they both are positions with different conditions.
They are coming from same table with satisfying different conditions. Please help me out to bring those objects.
why don't use 'UNION ALL' to get the superset of both?
(select distinct Placement, Position as origin
from Epict.Placementdetail where Placetype = 'LOAD')
UNION ALL
(select distinct placement, position as destination
from Epict.Placementdetail where placetype = 'DISCHARGE')
Regards,
Bilahari M
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As Aris_BO mentioned earlier,join using Placment may restirct the data depending on the values present.
Query1 result-Aliased Plctmnt1 in your query
Placement| Position |PlaceType
Place1 | Pos1 | LOAD
Query2 result-Aliased Plctmnt2 in your query
Placement| Position |PlaceType
Place2 |Pos2|DISCHARGE
In this case you won't get any data ,cos join codition fails- Place1 != Place2
But if you are looking for just a superset of Placement, Position with Placetype = 'LOAD' and 'DISCHARGE',simple OR codition will do.
select distinct Placement, Position as origin
from Epict.Placementdetail where Placetype in ( 'LOAD','DISCHARGE')
Not sure i got your problem correctly..
Hope this helps!!
Bilahari
Hello S.N...
If the Place Type is mutually exclusive, this query will not bring back any records..
if you have two separate queries in your webi report, that should help..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.