iteration of table data in power query

trackster

New Member
Joined
Jan 16, 2016
Messages
12
I need help with using a table that has web page numbers. I am wanting to use those page numbers and gather the data from those webpages.

here is what I have so far:

(page as number) as table =>
let
Source = Web.Page(Web.Contents("http://www.wvculture.org/vrr/va_dcdetail.aspx?Id=" & Number.ToText(page))),
Data0 = Source{0}[Data],
#"Changed Type" = Table.TransformColumnTypes(Data0,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Column3"}),
#"Transposed Table" = Table.Transpose(#"Removed Columns"),
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Death Record Detail...", type text}, {"Name:", type text}, {"Sex:", type text}, {"Death Date:", type text}, {"Death Place:", type text}, {"Age at Death:", type text}, {"Burial Place:", type text}, {"Burial Date:", type text}, {"Cemetery:", type text}, {"Funeral Home:", type text}, {"Birth Date:", type text}, {"Birth Place:", type text}, {"Marital Status:", type text}, {"Spouse:", type text}, {"Occupation:", type text}, {"Address:", type text}, {"Residence:", type text}, {"Mother:", type text}, {"Mother's Birth Place:", type text}, {"Father:", type text}, {"Father's Birth Place:", type text}, {"Informant:", type text}, {"Records maintained by West Virginia Archives & History#(cr)#(lf)For Research Purposes Only#(cr)#(lf)West Virginia Division of Culture and History#(cr)#(lf)Copyright 2018. All Rights Reserved.#(cr)#(lf)Privacy Notice", type text}})
in
#"Changed Type1"


here is what I have for my invoked function code:

let
Source = {94318..467833},
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Renamed Columns" = Table.RenameColumns(#"Converted to Table",{{"Column1", "page"}})
in
#"Renamed Columns"

I am trying to get all that data into one excel worksheet. could someone please help me with this?
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Assuming your function is named Query1

then invoke it like this:

Code:
let
    Source = List.Accumulate(
                {94318..94330},
                [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=table]#table[/URL] ({},{}),
                (state, current) => Table.Combine({state,[SIZE=3][COLOR=#ff0000][B]Query1[/B][/COLOR][/SIZE](current)})
             )
in
    Source
 
Upvote 0
I had to change a line or two in my original statement, but in combination with what you have it worked out very well. Thank you for the help!!!!
 
Upvote 0

Forum statistics

Threads
1,215,463
Messages
6,124,965
Members
449,201
Latest member
Jamil ahmed

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