PowerQueryを使いこなしていくと、数か月後にはPowerQueryのファイルパス(つまりソースとなるパス)を動的に操作する方法があれば、クエリはもっと良くなるのに、と思ったことがあるでしょう。
実は、あるんです!
この記事では、Excel Power Queryであたかも変数に値を導入して動的に値を変更する方法をご紹介します。
準備
まず、テーブル「Settings」を作成します。A列に「Name」B列に「Value」を入力します。A列には変数を、B列には値を入力します。参考までに今回のケースではCsv1Pathという変数を可変的にしていきたいと思います。
データ -> データの取得 -> クエリの結合 -> Power Queryエディターの起動をクリック
左のクエリエリアから右クリック=> 新しいクエリ => その他ソース => 空のクエリをクリックします。
詳細エディターをクリック
詳細エディターの中身には以下のように設定をします。詳細は次のコードをコピーして参照してみてください。
そしてクエリの名前をConfigに変更します。
let Config=(NameLabel) =>
let
Source = Excel.CurrentWorkbook(){[Name="Settings"]},[Content],
value = Source{[Name=NameLabel]}[Value]
in
value
in Config
ファイルパスを動的に変化させる
ファイルを読み込んでいる部分を変更していたいと思います。
現状ではFile.Contains(“ファイルのフルパス”)になっているところを
File.Contains(Config(“ファイルの変数名”))に変更したいと思います。
このように固定値であったファイルパスを変更することによって、変数のように扱うことができます。これを用いることによって、例えばExcelのひな形ファイルをテンプレートとして保存しておき、Settingsのテーブルの中身を変えるだけで様々なファイルを変更することができます。
76件のフィードバック
I’d like to find out more? I’d love to find out some additional
information.
Feel free to surf to my webpage; vpn coupon code 2024
My brother recommended I might like this website. He was totally right.
This post truly made my day. You can not imagine simply
how much time I had spent for this information! Thanks!
My web site; vpn coupon code 2024
This paragraph offers clear idea designed for
the new users of blogging, that genuinely how to do running a blog.
My site :: vpn coupon code 2024
Hey! Someone in my Facebook group shared this website with us so I came to take a look.
I’m definitely loving the information. I’m bookmarking and will be tweeting this to my followers!
Fantastic blog and outstanding design and style.
Feel free to surf to my webpage – vpn special coupon
You have made some good points there. I looked on the internet for more
information about the issue and found most individuals will go along with your views
on this site.
Also visit my web site; facebook vs eharmony to find love online
Its not my first time to pay a visit this web site,
i am browsing this web page dailly and obtain nice data from here all the time.
My web page … eharmony special coupon code 2024
Remarkable! Its actually awesome post, I have got much clear
idea concerning from this paragraph.
Feel free to surf to my webpage … nordvpn special coupon code
buying prescription drugs in mexico: cmqpharma.com – pharmacies in mexico that ship to usa
I was reading some of your articles on this website and I think this
website is very informative! Continue putting up.Raise your business
mexican pharmaceuticals online: online mexican pharmacy – mexican online pharmacies prescription drugs
I like this web site it’s a master piece! Glad I found this
ohttps://69v.topn google.Money from blog
п»їlegitimate online pharmacies india: indianpharmacy com – india pharmacy
mexico drug stores pharmacies: purple pharmacy mexico price list – mexican border pharmacies shipping to usa
online shopping pharmacy india: cheapest online pharmacy india – indian pharmacies safe
india online pharmacy: п»їlegitimate online pharmacies india – reputable indian pharmacies
canadian pharmacy online store: canadian pharmacy 24h com – canada drugs online reviews
mexican border pharmacies shipping to usa: buying prescription drugs in mexico – mexican pharmaceuticals online
northwest canadian pharmacy: real canadian pharmacy – best canadian pharmacy online
india pharmacy mail order: cheapest online pharmacy india – india pharmacy mail order
vipps canadian pharmacy: canadian pharmacies that deliver to the us – canadian pharmacy antibiotics
mexican drugstore online: mexican rx online – mexico drug stores pharmacies
medication from mexico pharmacy: medicine in mexico pharmacies – mexican online pharmacies prescription drugs
http://ciprodelivery.pro/# buy cipro online canada
http://clomiddelivery.pro/# where buy cheap clomid without dr prescription
amoxicillin no prescipion [url=http://amoxildelivery.pro/#]amoxicillin price canada[/url] amoxicillin 500mg buy online canada
https://paxloviddelivery.pro/# п»їpaxlovid
https://paxloviddelivery.pro/# paxlovid covid
paxlovid price [url=https://paxloviddelivery.pro/#]paxlovid covid[/url] paxlovid generic
http://clomiddelivery.pro/# how to get generic clomid pill
http://amoxildelivery.pro/# amoxicillin discount coupon
how to get clomid without insurance [url=http://clomiddelivery.pro/#]cheap clomid pill[/url] where to get generic clomid pills
https://clomiddelivery.pro/# buying generic clomid prices
http://clomiddelivery.pro/# where can i buy clomid pills
https://amoxildelivery.pro/# amoxicillin generic
buying generic clomid without insurance [url=https://clomiddelivery.pro/#]where to buy clomid tablets[/url] can you buy clomid no prescription
http://paxloviddelivery.pro/# paxlovid pharmacy
http://paxloviddelivery.pro/# Paxlovid over the counter
doxycycline usa [url=http://doxycyclinedelivery.pro/#]cheapest doxycycline tablets[/url] can you buy doxycycline over the counter in south africa
http://amoxildelivery.pro/# amoxicillin 500 mg tablet
https://clomiddelivery.pro/# buying generic clomid tablets
where can i get generic clomid pills [url=http://clomiddelivery.pro/#]can i get cheap clomid tablets[/url] where buy generic clomid price
http://ciprodelivery.pro/# buy cipro online without prescription
https://amoxildelivery.pro/# amoxicillin 500
order cheap clomid for sale [url=https://clomiddelivery.pro/#]cheap clomid tablets[/url] can you get cheap clomid without a prescription
http://clomiddelivery.pro/# buying cheap clomid without insurance
Well-structured and informative.
Great write-up, I?¦m normal visitor of one?¦s website, maintain up the nice operate, and It is going to be a regular visitor for a long time.
mexican pharmaceuticals online: п»їbest mexican online pharmacies – п»їbest mexican online pharmacies
buying prescription drugs in mexico: pharmacies in mexico that ship to usa – mexican border pharmacies shipping to usa
best online pharmacy india: india pharmacy mail order – india pharmacy
purple pharmacy mexico price list: mexican rx online – mexican mail order pharmacies
mexican online pharmacies prescription drugs: п»їbest mexican online pharmacies – medication from mexico pharmacy
medicine in mexico pharmacies: mexican drugstore online – mexican mail order pharmacies
online shopping pharmacy india: top 10 pharmacies in india – п»їlegitimate online pharmacies india
top online pharmacy india: mail order pharmacy india – indian pharmacy
india online pharmacy: india pharmacy – top 10 pharmacies in india
farmacia online envГo gratis: Cialis precio – farmacia online barata
se puede comprar viagra sin receta: comprar viagra contrareembolso 48 horas – viagra online cerca de zaragoza
farmacia online barcelona: farmacia online envio gratis murcia – farmacia online envГo gratis
Farmacia online piГ№ conveniente: Tadalafil generico migliore – Farmacia online piГ№ conveniente
viagra generico prezzo piГ№ basso: viagra generico – viagra generico in farmacia costo
comprare farmaci online all’estero: farmacia online – farmacie online sicure
comprare farmaci online all’estero: Farmacie che vendono Cialis senza ricetta – Farmacia online piГ№ conveniente
viagra online consegna rapida: viagra senza ricetta – viagra originale in 24 ore contrassegno
viagra generico prezzo piГ№ basso: viagra prezzo – cialis farmacia senza ricetta
siti sicuri per comprare viagra online: viagra generico – viagra generico sandoz
rybelsus generic: rybelsus price – rybelsus price
neurontin 100: neurontin brand coupon – neurontin 10 mg
neurontin 100 mg: neurontin 600 mg cost – neurontin 300 mg cap
prednisone brand name: prednisone 20mg – prednisone 1 mg for sale
pharmacy in canada: Canadian Pharmacy – medication canadian pharmacy
pharmacy website india: Indian pharmacy online – world pharmacy india
medicine in mexico pharmacies http://mexicanpharma.icu/# medication from mexico pharmacy
mexican rx online
mexico drug stores pharmacies: best online pharmacies in mexico – mexican online pharmacies prescription drugs
mexico pharmacies prescription drugs
buy rybelsus online: buy semaglutide pills – rybelsus cost
Ozempic without insurance: ozempic – buy ozempic pills online
buy semaglutide online: rybelsus coupon – buy rybelsus online
buy ozempic: ozempic coupon – ozempic generic
buy ozempic: Ozempic without insurance – ozempic coupon
cheapest rybelsus pills: semaglutide cost – rybelsus cost
ozempic cost: buy cheap ozempic – ozempic cost
http://zithromax.company/# average cost of generic zithromax
https://stromectol.agency/# stromectol ivermectin 3 mg