Data tables

tenspeed2

Board Regular
Joined
Jan 25, 2011
Messages
56
I have the 2019 Excel. After entering the url I am seeing 25 data tables. Question is I only need two tables.
As of now I have to open most of the tables to find the two I need. Is there a way to locate the two tables
I want to download into Excel?
 
Hi, is only a basic way, Python would be a good choice
You will need check this example, for me there are something to do (replace currency symbol, convert text to number,etc.)
I hope, I helped you

Copy and paste the code...Menu Data\New Query\From Other Sources\Blank Query

Code:
//StatementOfOperations
let
    Source = Web.Page(Web.Contents("https://www.sec.gov/Archives/edgar/data/1176199/000114544319000436/d364003.htm")),
    #"ReadAllData" = Table.ExpandTableColumn(Source, "Data", {"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10", "Column11", "Kind", "Name", "Children", "Text"}, {"Data.Column1", "Data.Column2", "Data.Column3", "Data.Column4", "Data.Column5", "Data.Column6", "Data.Column7", "Data.Column8", "Data.Column9", "Data.Column10", "Data.Column11", "Data.Kind", "Data.Name", "Data.Children", "Data.Text"}),
    #"RowsFilter" = Table.SelectRows(#"ReadAllData", each ([Data.Column1] = "Accounting and legal services fees" or [Data.Column1] = "Change in net unrealized appreciation (depreciation) of" or [Data.Column1] = "Custodian fees" or [Data.Column1] = "Dividends" or [Data.Column1] = "Expenses" or [Data.Column1] = "Futures contracts" or [Data.Column1] = "Increase in net assets from operations" or [Data.Column1] = "Interest" or [Data.Column1] = "Interest expense" or [Data.Column1] = "Investment income" or [Data.Column1] = "Investment management fees" or [Data.Column1] = "Less expense reductions" or [Data.Column1] = "Less foreign taxes withheld" or [Data.Column1] = "Net expenses" or [Data.Column1] = "Net investment income" or [Data.Column1] = "Net realized and unrealized gain" or [Data.Column1] = "Net realized gain (loss) on" or [Data.Column1] = "Other" or [Data.Column1] = "Printing and postage" or [Data.Column1] = "Professional fees" or [Data.Column1] = "Realized and unrealized gain (loss)" or [Data.Column1] = "Stock exchange listing fees" or [Data.Column1] = "Swap contracts" or [Data.Column1] = "Total expenses" or [Data.Column1] = "Total investment income" or [Data.Column1] = "Transfer agent fees" or [Data.Column1] = "Trustees' fees" or [Data.Column1] = "Unaffiliated investments" or [Data.Column1] = "Unaffiliated investments and foreign currency transactions") and ([Data.Column4] = null)),
    #"DropColumns" = Table.RemoveColumns(#"RowsFilter",{"Caption", "Source", "ClassName", "Id", "Data.Column3", "Data.Column4", "Data.Column5", "Data.Column6", "Data.Column7", "Data.Column8", "Data.Column9", "Data.Column10", "Data.Column11", "Data.Kind", "Data.Name", "Data.Children", "Data.Text"}),
    #"ChangeColNames" = Table.RenameColumns(#"DropColumns",{{"Data.Column1", "Col1"}, {"Data.Column2", "Col2"}})
in
    #"ChangeColNames"
 
Upvote 0

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
maybe with table of defined words are you looking for

LookupCustomColumn2
contract10-year u.s. treasury note futures640
divideunaffiliated investments, at value (cost $825,732,402)$846,771,907
expensecollateral held at broker for futures contracts747000
feedividends and interest receivable3346485
futurepayable for futures variation margin49987
increaseaccounting and legal services fees68271
Interesttrustees' fees526
Investmentother liabilities and accrued expenses127800
taxdividends$42,737,431
unaffiliateless foreign taxes withheld-60790
unrealizeinvestment management fees6221176
interest expense9100628
accounting and legal services fees116543
transfer agent fees27548
trustees' fees44674
custodian fees65430
professional fees63383
stock exchange listing fees25387
total expenses15866124
less expense reductions-63052
net expenses15803072
unaffiliated investments and foreign currency transactions-1615670
futures contracts-3626652
swap contracts331029
unaffiliated investments18673369
futures contracts-1261066
swap contracts-3149654
net realized and unrealized gain9351356
increase in net assets from operations$44,194,047
change in net unrealized appreciation (depreciation)14262649
increase in net assets resulting from operations44194047
from tax return of capital-7360791
issued pursuant to dividend reinvestment plan1068633
total increase (decrease)1515488
issued pursuant to dividend reinvestment plan50306
net increase in net assets from operations$44,194,047
collateral held at broker for futures contracts-74984
dividends and interest receivable-1250363
payable for futures variation margin19984
other liabilities and accrued expenses-56142
net increase in cash$57,611
net realized and unrealized gain (loss) on investments0.35
from tax return of capital-0.28
expenses before reductions2.95
expenses including reductions2.94
futures$(1,416,381)
swap contracts-1084408


Code:
// https://www sec gov/Archives/edgar/data/1176199/000114544319000436/d364003 htm
let
    Source = Web.Page(Web.Contents("https://www.sec.gov/Archives/edgar/data/1176199/000114544319000436/d364003.htm")),
    Expand = Table.ExpandTableColumn(Source, "Data", {"Column1", "Column2", "Column3"}, {"Column1", "Column2", "Column3"}),
    Criteria = Table.TransformColumns(Table.AddColumn(Table.SelectColumns(Expand,{"Column1", "Column2"}), "Custom", each Table1),{{"Column1", Text.Lower, type text}}),
    Condition = Table.AddColumn(Table.ExpandTableColumn(Criteria, "Custom", {"Lookup"}, {"Lookup"}), "Custom", each if Text.Contains([Column1], [Lookup]) then [Column1] else null),
    Filter = Table.Distinct(Table.SelectColumns(Table.SelectRows(Condition, each ([Custom] <> null) and ([Column2] <> "Number of#(cr)#(lf)contracts" and [Column1] <> null and [Column1] <> "" and [Column1] <> "*" and [Column1] <> "* * *") and ([Column2] <> "")),{"Custom", "Column2"}))
in
    Filter

Code:
// Table1
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Lower = Table.TransformColumns(Source,{{"Lookup", Text.Lower, type text}})
in
    Lower
 
Last edited:
Upvote 0
maybe with table of defined words are you looking for

This is an excelente choice, but when you work with Finance, there is an structure that you must follow, in this case, you may receive data that does not correspond to the financial statement (Statement of Operations), you just have to be careful with this.
 
Upvote 0
The Table of defined words may contain a few words in a cells not single word only, like:
Less expense reductions
foreign taxes
statement of operations

and so on...

On the end, you can filter result manually if necessary
 
Last edited:
Upvote 0
The Table of defined words may contain a few words in a cells not single word only, like:
Less expense reductions
foreign taxes
statement of operations

and so on...

On the end, you can filter result manually if necessary
(y) Exactly, based in you first answer (proposed), it necessary this clarify, because the users could be use an single word, waiting right results
 
Upvote 0
I assumed people are thinking (sometimes) :LOL: [joke]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,487
Messages
6,125,085
Members
449,206
Latest member
ralemanygarcia

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top