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
walkra
Helper III
Helper III

Use functions in "SQL Instructions (Optional)"

Hi, How Are You?. 

 

I want to connect by ODBC to a base,

 

Untitled.png

 

and in the connection screen there is the possibility of entering an SQL statement in "SQL Statement (optional)".

 

Conección.png

I want to enter the following sentence (I'm not very skilled in SQL and maybe there is some other error, although if you do not enter the word FIRST, works):

 

SELECT CONSULTOR, FIRST(MODULO), FIRST(TEAM_LEADER), FIRST(PAIS)
FROM Tabla1
GROUP BY CONSULTOR
ORDER BY HASTA desc

 

When I proceed to connect with that sentence, it indicates the error:

 

Error.png

How can I enter a function within a sql statement in this place?

Thank you, very much. 

5 REPLIES 5
Anonymous
Not applicable

Hi @walkra 

Which DB is used?
FIRST is not a legal function in this DB instance.

 

Thanks

A

Hi, AClerk, How are you?.
I connect to Solman (from SAP). I can only connect to use some predefined views (I have no chance to make any changes inside that one). To not bring all the records of a query I wanted to use some SQL statement. Is there any possibility to simulate FIRST ?.

Thank you very much!.

Anonymous
Not applicable

Hi @walkra 

I am not an expert of Solman, nor SAP.

Anyhow, reading the documentations you might need to use a function named 'FIRST_VALUE'.

Assuming you are using HANA DB.

Good Luck!
A

Hi AClerk, how are you?. 

I think that function corresponds to Solman/SAP, but where I want to write the SQL statement is within Power BI (although I use an ODBC connector to take information from a Solman view). I believe that the language of this SQL of Power Bi does not belong to Solman/SAP. Anyway, I also used the function that You indicate to me and unfortunately, it does not recognize it. 

Thank you very much for your help!!

Anonymous
Not applicable

@walkra 

In PBI you should use the same syntax you use for the original DB.

So you should use the syntax used for Solman, which I am not sure what it is.

Thanks

A

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.