0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Qliksense】フォルダにある複数のエクセルファイルをfor文で簡単に読み込む

Posted at

#これは何か
毎月蓄積しているエクセルファイルがあるとします。そのすべて読み込むのは、ワイルドカードを使ってロードすれば良いですが、例えば、直近半年だけロードする場合、for eachを使うと楽になるという備忘録です。

■フォルダ例
Sample
└201901_売上.xlsx
└201902_売上.xlsx
└201903_売上.xlsx



└202103_売上.xlsx

#結論
for each 変数 in を使う。変数に該当年月を指定し、nextで繰り返す。

#スクリプト


for each month in 202010,202011,202012,202101,202102,202103

LOAD
    年月,
    売上,
    顧客
FROM [lib://Sample/$(month)_売上.xlsx]
(ooxml, embedded labels, table is Sheet1);

next
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?