cancel
Showing results for 
Search instead for 
Did you mean: 

Different Ways of Code

former_member203645
Active Participant
0 Kudos

Can I build a query in a different way without using alias tables of position,physical Quantity in the WEBI report level.

 (SELECT   DISTINCT pp2.trade subtrade, 
                                         pq2.shipment subshipment, 
                                         pp2.POSITION subposition, 
                                         pq2.measure 
                                    FROM counterparty cp, 
                                         position pp, 
                                         physicalquantity pq, 
                                         physicalquantity pq2, 
                                         position pp2 
                                   WHERE pp.POSITION = pq.POSITION 
                                     AND pq.quantitystatus = 'ACTUAL' 
                                     AND pq.shipment = pq2.shipment 
                                     AND pp2.POSITION = pq2.POSITION 
                                     AND pq2.quantitystatus = 'ACTUAL' 
                                     AND (pp.position <> pp2.position OR pp2.position IS NULL) 
                                     AND pp.counterparty = cp.counterparty(+))  

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

My questions:

Why are you using "position pp" and "position pp2"?

Why are you using "physicalquantity pq" and "physicalquantity pq2"?

Are you using custom SQL? "Edit query" / SQL / use Custom SQL

If you really need this like it is, I think you can change this sentence a little

Other way of doing this is: In the "Edit Query"

- Create 2 queries, one for position and other for physicalquantity

- Select key figures and dimensions/caracteristics from tables then in the "Query filters" add attributes for selection, this way you will turn this code more simple.

Finally go to "Edit report" and select "Merge dimensions"

Hope this helps

Answers (0)