Created
September 12, 2022 06:14
-
-
Save Softwaretrain/5d6dabbc67e4fe9ca459580b45818188 to your computer and use it in GitHub Desktop.
Solution to Excel BI Excel/Power Query Challenge 19
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 | |
Source=Excel.CurrentWorkbook(){[Name="Table1"]}[Content], | |
CustomColumn = Table.AddColumn(Source, "Answer", each let | |
Spl=Text.Split([Sentence]," "), | |
lenSpl=List.Transform(Spl,each Text.Length(_)), | |
addlen=List.Zip({Spl,lenSpl}), | |
tbl=#table({"Sentence","length"},addlen), | |
filter=Table.SelectRows(tbl, | |
let max = List.Max(tbl[length]) | |
in each | |
[length] = max)[[Sentence]][Sentence], | |
combine=Text.Combine(filter,", "), | |
proper=Text.Proper(combine) | |
in proper) | |
in | |
CustomColumn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment