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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

SAP HANA DirectQuery SQL code

Hi all,

 

I am facing the following issue when trying to connect an existent query from SAP to PBI through the DirectQuery feature.

 

 

gustavovalentim_0-1601539197932.png

 

The code I am using is:

 

SELECT T0."itemcode",
T0."itemname",
T1."price",
T1."currency",
T2."price",
T2."currency"
FROM oitm T0
INNER JOIN itm1 T1
ON T0."itemcode" = T1."itemcode"
AND T1."pricelist" = 1
INNER JOIN itm1 T2
ON T0."itemcode" = T2."itemcode"
AND T2."pricelist" = 2

 

It seems that there is an issue with the sintaxe which I cant seem to figure. 

 

Ps.: I have other queries working just fine but not this one.

 

Could you anyone give some light, please?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous 
Is "oitm" a variable or a temporary table? If "oitm" is just a variable, you have to write ":oitm" (with the colon in front).

SAP HANA will determine if and what needs to be materialized during run time.

 

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

@Anonymous 
Is "oitm" a variable or a temporary table? If "oitm" is just a variable, you have to write ":oitm" (with the colon in front).

SAP HANA will determine if and what needs to be materialized during run time.

 

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.