Динамические имена полей в запросах Excel

484
LWC

Как объясняется здесь, запросы Excel принимают динамические значения (например, «где имя =?» И «?» Могут быть связаны с ячейкой по вашему выбору).

Увы, запросы Excel, похоже, не принимают динамические имена полей (например, «имя» в «где имя»). Есть ли способ обойти это ограничение? Ну, другой способ, чем этот .

Спасибо!

0

1 ответ на вопрос

0
Mike Honey

I would use the Power Query Add-In for this. I first add an Index column, then duplicate the Query.

In the duplicate, I would select the Index and choose Unpivot Columns / Unpivot Other Columns (PQ Transform ribbon). This will convert each cell into a row, with Attribute (field name) and Value columns.

I would then filter on the Attribute and Value fields, which would give you a list of which Index values to keep.

Then I would return to the original query, and use Merge Queries (PQ Home ribbon) to join it to the duplicated query, matching on the Index columns and using the Join Kind: Inner.

Похожие вопросы