Last active
April 19, 2022 20:41
-
-
Save ImkeF/99c7e2dcca4b49076a5741dd5914bcce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let func = | |
(SqlExpression as text) => | |
let | |
Source = Expression.Evaluate(SqlExpression.ToExpression(SqlExpression, #shared), #shared) (#shared) | |
in | |
Source | |
, documentation = [ | |
Documentation.Name = " Syntax.UseSQL | |
", Documentation.Description = " Use SQL-statement to query your M-tables (!!!) in your current file. | |
" , Documentation.LongDescription = " Use SQL-statement to query your M-tables (!!!) in your current file. This is an experimental feature that might be removed. | |
", Documentation.Category = " AccessingData | |
", Documentation.Source = " https://ssbi-blog.de/technical-topics-english/the-environment-concept-in-m-for-power-query-and-power-bi-desktop-part-3/#comment-134 | |
", Documentation.Author = " Imke Feldmann: www.TheBIccountant.com | |
", Documentation.Examples = {[Description = " | |
" , Code = " | |
", Result = " | |
"]}] | |
in | |
Value.ReplaceType(func, Value.ReplaceMetadata(Value.Type(func), documentation)) |
Sorry, but I'm not aware of these details.
As said in the function documentation, this is an experimental feature - I wouldn't be surprised to find some limitations in it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I can't get this to accept an SQLExpression that uses CASE WHEN. Is this possible? Is only T-SQL supported or can other SQL variants be used?