cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

Re: Insert Parameter in M language

Thanks @ImkeF , an honour to have you posting in the same thread! Thanks for all the effort you put in. Smiley Happy

Highlighted
Helper IV
Helper IV

Re: Insert Parameter in M language

@ImkeF @Jtb790  Yes, that is not an error. But the if you see the blue highlighted part in my image. This is in addion of server name. that means the code is changing my server name to value from paramter(Cname;Sname) including semicolon as well.

  1. Sname is SchemaName (parameter 1)
  2. Cname is ServerName (parameter 2)

Which makes the wrong server name and lead to error message. Please see the screenshot below. I have marked everything to make it more clear for you. Thank you for your help.

 

ServerName.jpg

 

 

Highlighted
Advocate I
Advocate I

Re: Insert Parameter in M language

Hi Kulchandra,

 

In your message you call the Sname variable your Schema, I believe this should be the Database within your Server. Maybe lost in translation, but that stands out to me.

 

If this is correct, your original query states the Database in the Select statement, therefore giving the Database twice.

 

My advice would be to first, run a simple query on your database using the non parameterised Server:Port and Database details, then examin the code it produces, using the Advanced Editor window. For my instance, I need to specify the implementation, if you see my original code. I got that from using the editor after using the above technique.

 

Hope that helps.

 

Highlighted
Helper IV
Helper IV

Re: Insert Parameter in M language

Hi @Jtb790 @ImkeF  As per you suggestion I have made my query without Parameter. And, it looks like this(plz see screenshot) in Advance Editor windows and works perfectly fine without parameter.

What I am trying to do is embed the Parameter2 (Sname) in to Select Statment. I am able to embed server name Parameter1 (CName) already.

Hope you will find something on this image that will help to solve the problem i am facing. I am very thankful you guys are following up on this.

 

Without Parameter.jpg

Highlighted
Helper IV
Helper IV

Re: Insert Parameter in M language

Hi @Jtb790 Thank you for your effort to help me to solve this problem for me. I am happy to tell you that finally I found the exact solution for passing parameter into select statement in SAP HANA.

Here is the simple one line code that worked for me. 🙂

 

let
Source=SapHana.Database(CName, [Query="SELECT  * FROM "&SName&".""FN_PowerBI_SampleFunctionName""();"])
in
Source

Thanks, Kulchandra Neupane

 

Highlighted
Regular Visitor

Re: Insert Parameter in M language

This worked for me but had to enter as ""&request)), that was the name of my parameter

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Power BI Desktop August 2020 Update

Power BI Desktop August 2020 Update

We have great updates this month! Click the link for the video with more info.

Top Solution Authors
Top Kudoed Authors