Excel PowerQuery - ошибка ссылки на ячейку более 260 символов - PullRequest
0 голосов
/ 10 декабря 2018

Я пытаюсь использовать Excel PowerQuery для извлечения данных с веб-страницы, используя ячейку в рабочей книге для генерации URL-адреса.URL объединяется, поскольку идентификаторы приходят из другого источника и в настоящее время имеют длину 1043 символа.

Я использую ответ из этого предыдущего вопроса , чтобы выполнить задачу получения значения ячейки взапрос, но я получаю сообщение об ошибке, поскольку оно превышает 260 символов.

Есть ли способ обойти эту ошибку?

let
    Source = Excel.Workbook(File.Contents(GetValue("SourceFile"))),
    #"Removed Columns" = Table.RemoveColumns(Source,{"Name", "Item", "Kind", "Hidden"}),
    #"Expanded Data" = Table.ExpandTableColumn(#"Removed Columns", "Data", {"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10", "Column11", "Column12", "Column13", "Column14", "Column15", "Column16", "Column17", "Column18", "Column19", "Column20", "Column21", "Column22", "Column23", "Column24"}, {"Data.Column1", "Data.Column2", "Data.Column3", "Data.Column4", "Data.Column5", "Data.Column6", "Data.Column7", "Data.Column8", "Data.Column9", "Data.Column10", "Data.Column11", "Data.Column12", "Data.Column13", "Data.Column14", "Data.Column15", "Data.Column16", "Data.Column17", "Data.Column18", "Data.Column19", "Data.Column20", "Data.Column21", "Data.Column22", "Data.Column23", "Data.Column24"}),
    #"Promoted Headers" = Table.PromoteHeaders(#"Expanded Data", [PromoteAllScalars=true]),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Project ID", Int64.Type}, {"Project Name", type text}, {"Project Action Status", type text}, {"ID", Int64.Type}, {"Title", type text}, {"Owner", type text}, {"Start date", Int64.Type}, {"Due date", Int64.Type}, {"Actual start date", Int64.Type}, {"Actual end date", Int64.Type}, {"Planned working time", type number}, {"Tracked working time", type number}, {"State", type text}, {"Is overdue?", type logical}, {"Milestone", type text}, {"Project group", type text}, {"Files", Int64.Type}, {"Tags", type any}, {"Predecessor tasks", type any}, {"Successor tasks", type any}, {"Last updated at", type number}, {"Last updated by", type text}, {"Description", type text}, {"Last correspondence", type text}})
in
    #"Changed Type"

Ответы [ 2 ]

0 голосов
/ 11 декабря 2018

Я нашел ответ на свой вопрос здесь , используя следующее решение:

let
    MyURL = Excel.CurrentWorkbook(){[Name="PQLink"]}[Content][Column1]{0},
    Source = Excel.Workbook(Web.Contents(MyURL)),
    #"Removed Columns" = Table.RemoveColumns(Source,{"Name", "Item", "Kind", "Hidden"}),
    #"Expanded Data" = Table.ExpandTableColumn(#"Removed Columns", "Data", {"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10", "Column11", "Column12", "Column13", "Column14", "Column15", "Column16", "Column17", "Column18", "Column19", "Column20", "Column21", "Column22", "Column23", "Column24"}, {"Data.Column1", "Data.Column2", "Data.Column3", "Data.Column4", "Data.Column5", "Data.Column6", "Data.Column7", "Data.Column8", "Data.Column9", "Data.Column10", "Data.Column11", "Data.Column12", "Data.Column13", "Data.Column14", "Data.Column15", "Data.Column16", "Data.Column17", "Data.Column18", "Data.Column19", "Data.Column20", "Data.Column21", "Data.Column22", "Data.Column23", "Data.Column24"}),
    #"Promoted Headers" = Table.PromoteHeaders(#"Expanded Data", [PromoteAllScalars=true]),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Project ID", Int64.Type}, {"Project Name", type text}, {"Project Action Status", type text}, {"ID", Int64.Type}, {"Title", type text}, {"Owner", type text}, {"Start date", Int64.Type}, {"Due date", Int64.Type}, {"Actual start date", Int64.Type}, {"Actual end date", Int64.Type}, {"Planned working time", type number}, {"Tracked working time", type number}, {"State", type text}, {"Is overdue?", type logical}, {"Milestone", type text}, {"Project group", type text}, {"Files", Int64.Type}, {"Tags", type any}, {"Predecessor tasks", type any}, {"Successor tasks", type any}, {"Last updated at", type number}, {"Last updated by", type text}, {"Description", type text}, {"Last correspondence", type text}})
in
    #"Changed Type"
0 голосов
/ 10 декабря 2018

File.Contents, вероятно, имеет ограничение на количество символов, связанное с ограничением пути к файлу в Windows.Поскольку вы получаете данные с веб-сайта, попробуйте использовать Web.Contents вместо File.Contents.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...