-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
querys #13
Comments
Hey, @Flipe-TI, what sort of query are you looking for? There is no way of running DAX against a PBIX file if that's your ask. |
Hi @Hugoberry,
query: SELECT
EmployeeID,
FirstName,
LastName,
JobTitle,
HireDate,
Department,
Salary,
CASE
WHEN Salary > 50000 THEN 'High'
ELSE 'Low'
END AS SalaryLevel,
CASE
WHEN JobTitle = 'Manager' THEN 'High'
ELSE 'Medium'
END AS HierarchyLevel
FROM
Employees
WHERE
Department = 'Sales'
AND Salary > 40000
AND YEAR(HireDate) >= 2015
AND FirstName LIKE '%John%'
ORDER BY
Salary DESC This query is used at the beginning of the M code. What I am referring to is a feature that searches for and returns only the queries used in the dataset. I’m currently using this amazing library to generate documentation for my PBIX files (once again, congratulations on the great work, it’s incredibly useful!). It would be awesome to have a dedicated tab just for the queries or data sources. |
Interesting idea. I know the library doesn't capture all of the m code via import re
def extract_query_from_powerquery(powerquery_text: str) -> str:
# Find the Query parameter using regex
query_match = re.search(r'\[Query="(.*?)"\]', powerquery_text, re.DOTALL)
if not query_match:
return ""
query = query_match.group(1)
# Replace Power Query special characters
replacements = {
"#(lf)": "\n", # linefeed
"#(tab)": "\t" # tab
}
# Perform the replacements
for old, new in replacements.items():
query = query.replace(old, new)
return query.strip() courtesy of LLMs |
Hi @Hugoberry,
First of all, many thanks for this library! This is very useful for me.
I'm wondering if you have plans to add functionality for specifically querys?
The text was updated successfully, but these errors were encountered: