Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Leeeeeevin
New Member

SAP Business One Query

Hello,

 

i have a problem with a SQL-Query from SAP Business one. 

 

I have 4 tables: 

 

ORDR - This is the sales order table

RDR1 - These are the sales order lines 

 

ODLN - This is the delivery table

DLN1 - These are the delivery lines 

 

In SQL i do the join like this:

 

SELECT DISTINCT

T1.DocNum, T1.DocDate, T1.CardCode,
T1.DocEntry AS 'ORDR DocEntry',
T0.LineNum AS 'RDR1 LineNum',
T0.ItemCode,
T2.BaseEntry AS 'DLN1 BaseEntry',
T2.BaseLine AS 'DLN1 BaseLine',
T2.ItemCode,
T0.TrgetEntry AS 'RDR1TrgetEntry',
T3.DocEntry AS 'ODLN DocEntry'

FROM RDR1 T0 

LEFT OUTER JOIN ORDR T1
ON T0.DocEntry = T1.DocEntry

LEFT OUTER JOIN DLN1 T2
ON T1.DocEntry = T2.BaseEntry
AND T0.LineNum = T2.BaseLine
AND T0.ItemCode = T2.ItemCode

LEFT OUTER JOIN ODLN T3
ON T2.DocEntry = T3.DocEntry

 

The problem now is the red part. How can i map this in PowerBi?

 

Thank you very much 

 

Levin

 

2 ACCEPTED SOLUTIONS
Icey
Community Support
Community Support

Hi @Leeeeeevin ,

 

Does the red code mean that left outer join two tables based on three columns?

If so, hold "Ctrl" and select matching columns one by one like so:

merge.JPG

 

If this is not what you want, please provide more details.

 

 

Best regards

Icey

 

If this post helps, then consider Accepting it as the solution to help other members find it faster.

View solution in original post

Hey Icey, 

 

sometimes the solution is easier than you think 😅. Thank you very much! 

 

I also found another option to put the SQL-Query in PowerBi: 

 

Screenshot 2021-03-03 084141.gif

Maybe it will help someone who has the same problem

 

Best regards and thank you!

Levin

View solution in original post

3 REPLIES 3
Icey
Community Support
Community Support

Hi @Leeeeeevin ,

 

Does the red code mean that left outer join two tables based on three columns?

If so, hold "Ctrl" and select matching columns one by one like so:

merge.JPG

 

If this is not what you want, please provide more details.

 

 

Best regards

Icey

 

If this post helps, then consider Accepting it as the solution to help other members find it faster.

Hey Icey, 

 

sometimes the solution is easier than you think 😅. Thank you very much! 

 

I also found another option to put the SQL-Query in PowerBi: 

 

Screenshot 2021-03-03 084141.gif

Maybe it will help someone who has the same problem

 

Best regards and thank you!

Levin

Hi @Leeeeeevin ,

 

Thanks for sharing another solution!😉 You can also accept your reply as a solution, too. Your contribution is highly appreciated.

 

 

Best Regards,

Icey

 

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.