Forum Discussion
power query and time format
- Jan 22, 2020
Another variant, and if more close to the formula you used in Excel
the script is
let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], TrimmText = Table.TransformColumns( Table.TransformColumnTypes( Source, {{"A", type text}}, "en-GB" ), {{"A", Text.Trim, type text}} ), CleanText = Table.TransformColumns( Table.TransformColumnTypes( TrimmText, {{"A", type text}}, "en-GB" ), {{"A", Text.Clean, type text}} ), ConvertToTime = Table.ReplaceValue( CleanText, each [A] , each Time.FromText( Text.Start([A],2) & Text.End([A],2) ), Replacer.ReplaceValue,{"A"} ) in ConvertToTimeIf source data is more clean that could be simply = Time.FromText([A])
Thank you again for the help. it works!
The problem now is that I don't know where i was wrong the the commands as once the excel is opened, it's start running and consuming CPU until the laptop blocks.
Could you have a look on the attached excel?
Please note that as I have so many "replace" commands, I have just copied the first and last command of each series of "replace" commands
It's hard to analyse the query in such format. Is it possible to attach the Excel file with the latest query and perhaps sample of source text file with more realistic data?
- SergeiBaklanFeb 12, 2020Diamond Contributor
That's strange. Please ask techcommunity@microsoft.com to sort this out.
- juan jimenezFeb 12, 2020Iron Contributorhi,
i get this messeage "You have reached the limit for number of private messages that you can send for now. Please try again later."
and i have sent just a few messages over the last 2 years.... - SergeiBaklanFeb 11, 2020Diamond Contributor
Hi Juan,
Please send me a private message here, will contact through it. The only I don't promise quick answer.
- juan jimenezFeb 10, 2020Iron Contributor
Dear Sergei,
You have helped me a lot on this topic.
However if I am going to send you some documents with private information I wonder if I could send you any other way privately.
Thank again, Juan