This file contains hidden or 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 = "Data"]}[Content], | |
| #"Added Index" = Table.AddIndexColumn(Source, "Index", 1, 1, Int64.Type), | |
| #"Duplicated Column" = Table.DuplicateColumn(#"Added Index", "Data", "Data - Copy"), | |
| #"Changed Type" = Table.TransformColumnTypes( | |
| #"Duplicated Column", | |
| {{"Data", type text}, {"Data - Copy", type text}} | |
| ), | |
| #"Split Column by Space" = Table.ExpandListColumn( | |
| Table.TransformColumns( |
This file contains hidden or 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 = "Data"]}[Content], | |
| #"Changed Type" = Table.TransformColumnTypes( | |
| Source, | |
| {{"Sequence", type text}, {"Target", Int64.Type}} | |
| ), | |
| AddedNestedList = Table.AddColumn( | |
| #"Changed Type", | |
| "List1", | |
| each |
This file contains hidden or 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 = "Data"]}[Content], | |
| #"Changed Type" = Table.TransformColumnTypes(Source, {{"Data", type text}}), | |
| Tx = Table.TransformColumns( | |
| #"Changed Type", | |
| { | |
| "Data", | |
| each [ | |
| Category = Text.Trim(Text.Split(_, ">"){0}), | |
| Transaction = Text.Trim(List.Last(List.RemoveLastN(Text.Split(_, ":"), 1))), |
This file contains hidden or 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 = "Data"]}[Content], | |
| #"Changed Type" = Table.TransformColumnTypes(Source, {{"Data", type text}}), | |
| #"Split Column by Delimiter" = Table.SplitColumn( | |
| #"Changed Type", | |
| "Data", | |
| Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), | |
| {"Data.1", "Data.2", "Data.3", "Data.4"} | |
| ), | |
| #"Changed Type After Split" = Table.TransformColumnTypes( |
This file contains hidden or 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 = "Data"]}[Content], | |
| #"Changed Type" = Table.TransformColumnTypes(Source, {{"Data", type text}}), | |
| Base = Table.AddColumn( | |
| #"Changed Type", |
This file contains hidden or 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 | |
| SelectCase = (value as any, l as list, default as any) as any => | |
| let | |
| // Function to select nth item of list | |
| // If you pass in zero, you get even indices (predicates) | |
| // If you pass in one, you get odd indices (results) | |
| fnSelectEvenOdd = (lst as list, remainder as number) as list => | |
| let | |
| result = List.Select( | |
| lst, |
This file contains hidden or 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
| function Main($arg, $context) | |
| $prompter = DialogBox_Create("") | |
| DialogBox_AddLabel($prompter, "1 - Objective") | |
| DialogBox_AddLabel($prompter, " ") | |
| DialogBox_AddTextBox($prompter, "&Task", "Task", "", false) | |
| DialogBox_AddDropDown($prompter, "&Output format", "OutputFormat", "Prose", Array("Prose", "Bullet list", "Numbered list", "Table", "JSON", "Code", "Step-by-step")) | |
| DialogBox_AddDropDown($prompter, "&Length target", "LengthTarget", "Concise", Array("Very short", "Concise", "Medium", "Long")) | |
This file contains hidden or 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
| // Function to calculate the distance between two geographic coordinates | |
| GetDistance(lat1:Number, lon1:Number, lat2:Number, lon2:Number):Number = With( | |
| { | |
| // Convert latitude and longitude differences from degrees to radians | |
| dLat: (lat2 - lat1) * Pi() / 180.0, | |
| dLon: (lon2 - lon1) * Pi() / 180.0, | |
| // Convert original latitudes to radians |
This file contains hidden or 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
| (l as list, selections as list)=> | |
| let | |
| Source = | |
| List.Accumulate( | |
| selections, | |
| {}, | |
| (state,current)=> | |
| if | |
| Text.Contains(current,":") | |
| then |
This file contains hidden or 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
| (l as list, range as list)=> | |
| let | |
| Start_Position = List.PositionOf(l, range{0}), | |
| End_Position = List.PositionOf(l, range{1}), | |
| Result= List.Range(l,Start_Position,(End_Position-Start_Position)+1) | |
| in | |
| Result |
NewerOlder