Jun 27 2022 05:52 AM
Hi,
i would very much appreciate if anyone can help with something that i thought would have been possible but i am having no luck achieving it.
i run a power query that gets data from the web from the site https://en.wikipedia.org/wiki/London
and i am trying to get the "london" part of that web adress to appear as a column in the same power query results.
i know if i can get the address "https://en.wikipedia.org/wiki/London" , as a column in my power query, then i will know how be able to extract the "london" part by using split columns etc.
its just i cant get any of the actual source address text (above) and cant put it into the power query anywhere. Is this possible ??
i have attached my document , which is just a working doc of what im trying to achieve.
so i have a power query that gets the data from the web address of https://en.wikipedia.org/wiki/London
i have the web address in cell L1 and i have gived it a named reference of Address04
my source code for my power query
let
getAddress04 = Excel.CurrentWorkbook(){[Name="Address04"]}[Content]{0}[Column1],
Source = Web.Page(Web.Contents(getAddress04, [Timeout=#duration(0, 0, 3, 0)])),
Data6 = Source{6}[Data],
#"Changed Type" = Table.TransformColumnTypes(Data6,{{"Header", type text}, {"Country of birth", type text}, {"Population", Int64.Type}})
in
#"Changed Type"
Really hoping that this is possible and someone can help me out with this, it would be very much appreciated, with many thanks, steve r
Jun 27 2022 05:57 AM
Jun 27 2022 06:14 AM
SolutionYou may extract city from URL as
city = Text.AfterDelimiter( getAddress04, "/", {0, RelativePosition.FromEnd} )
and add the value to custom column
Jun 27 2022 06:32 AM
Jun 27 2022 06:38 AM
Jun 27 2022 08:11 AM
@stever78 , you are welcome.
Yes, that's with advanced editor.
Jun 27 2022 06:14 AM
SolutionYou may extract city from URL as
city = Text.AfterDelimiter( getAddress04, "/", {0, RelativePosition.FromEnd} )
and add the value to custom column