Skip to content

Instantly share code, notes, and snippets.

@stevedep
Created January 3, 2023 17:29
Show Gist options
  • Save stevedep/0508f232b965aba92d37e882c4bcd554 to your computer and use it in GitHub Desktop.
Save stevedep/0508f232b965aba92d37e882c4bcd554 to your computer and use it in GitHub Desktop.
let
Source = List.Generate(() => 1, each _ <= NumberOfPages, each _ + 1),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type text}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Column1", "Page"}}),
#"Added Custom" = Table.AddColumn(#"Renamed Columns", "Data", each fnCarData([Page])),
#"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Data"}),
#"Expanded Data" = Table.ExpandTableColumn(#"Removed Other Columns", "Data", {"id", "title", "price", "year", "fuel", "provider", "licensePlate", "km", "description", "nameEntry", "place", "province", "endAuction", "ModelInfo", "CatalogPrice"}, {"id", "title", "price", "year", "fuel", "provider", "licensePlate", "km", "description", "nameEntry", "place", "province", "endAuction", "ModelInfo", "CatalogPrice"}),
#"Added Custom1" = Table.AddColumn(#"Expanded Data", "age", each 2022 - [year]),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom1",{{"age", Int64.Type}, {"price", Int64.Type}, {"id", Int64.Type}}),
#"Removed Duplicates" = Table.Distinct(#"Changed Type1", {"id", "price", "year", "fuel", "licensePlate", "km", "CatalogPrice", "age"})
in
#"Removed Duplicates"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment