Skip to content

Instantly share code, notes, and snippets.

@petermreid
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petermreid/57c7db8ad8b3251a2cc8 to your computer and use it in GitHub Desktop.
Save petermreid/57c7db8ad8b3251a2cc8 to your computer and use it in GitHub Desktop.
Yahoo Quotes Portfolio
let
PortfolioSource = Excel.CurrentWorkbook(){[Name="Portfolio"]}[Content],
#"sParam" = Text.Combine(Table.ToList(Table.SelectColumns(PortfolioSource, "Symbol")),","),
#"Fields" = Excel.CurrentWorkbook(){[Name="FieldLookup"]}[Content],
#"DisplayFields" = Table.SelectRows(#"Fields",each [Display]=true),
#"fParam" = Text.Combine(Table.ToList(Table.SelectColumns(#"DisplayFields", "f")),""),
#"DisplayColumns" = Table.ToList(Table.SelectColumns(#"DisplayFields", "Name")),
#"TypeNames" = Table.SelectRows(Table.SelectColumns(#"DisplayFields", {"Name","Type"}), each [Type]="number"),
#"ColumnTypes" = Table.AddColumn( #"TypeNames", "AsType", each type number),
#"ColumnTypesList" = Table.ToRows( Table.SelectColumns(#"ColumnTypes",{"Name","AsType"})),
#"YahooSource"= Csv.Document(Web.Contents("http://download.finance.yahoo.com/d/quotes.csv?s=" & #"sParam" & "&f=" & #"fParam"), #"DisplayColumns"),
#"TypedYahooSource" = Table.TransformColumnTypes(#"YahooSource", #"ColumnTypesList")
in
#"TypedYahooSource"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment