Forum Discussion
KunalMathkar
1 year agoFrequent Visitor
I need support for write or rectify query
I have connected power bi with clickhouse database. my table name is "jira_issues" i have explained query below i have pasted this in chatgpt and i got elow response as query - let Sou...
- 1 year ago
yes i got ny correct query and query is here
let// Connect to the ClickHouse databaseSource = ClickHouse.Database("10.1.1.1", 1, null, []),// Navigate to the specific database and tableDB = Source{[Name = "abc", Kind = "Database"]}[Data],JiraIssues = DB{[Name = "jira", Kind = "Table"]}[Data],// Define the mapping of custom field names to friendly namesCustomFieldMap = [customfield_10000 = "Request participants",customfield_10103 = "Account"// Add more mappings here, separated by commas],// Get all column names from the tableColumnNames = Table.ColumnNames(JiraIssues),// Generate a list of {oldName, newName} pairs based on the mappingRenamedColumnsList = List.Transform(ColumnNames, (colName) =>letmatchingKey = List.First(List.Select(Record.FieldNames(CustomFieldMap), each Text.StartsWith(colName, _)), null),newName = if matchingKey <> null thenText.Replace(colName, matchingKey, Record.Field(CustomFieldMap, matchingKey))elsecolNamein{colName, newName}),// Apply the renaming to the tableRenamedTable = Table.RenameColumns(JiraIssues, RenamedColumnsList)inRenamedTable
KunalMathkar
1 year agoFrequent Visitor
i changed acording to your suggestion , now below error
jgeddes
1 year agoSuper User
What does your complete code in the advanced editor look like now?