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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors