<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>集計 on qwerty.work</title>
        <link>https://qwerty.work/tags/%E9%9B%86%E8%A8%88/</link>
        <description>Recent content in 集計 on qwerty.work</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>ja-JP</language>
        <lastBuildDate>Thu, 19 Jan 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://qwerty.work/tags/%E9%9B%86%E8%A8%88/index.xml" rel="self" type="application/rss+xml" /><item>
            <title>【Kintone】関連レコード一覧内の金額や数値を集計してフィールドに登録するJavascript</title>
            <link>https://qwerty.work/post/2023/01/kintone%E9%96%A2%E9%80%A3%E3%83%AC%E3%82%B3%E3%83%BC%E3%83%89%E4%B8%80%E8%A6%A7%E5%86%85%E3%81%AE%E9%87%91%E9%A1%8D%E3%82%84%E6%95%B0%E5%80%A4%E3%82%92%E9%9B%86%E8%A8%88%E3%81%97/</link>
            <pubDate>Thu, 19 Jan 2023 00:00:00 +0000</pubDate>
            <guid>https://qwerty.work/post/2023/01/kintone%E9%96%A2%E9%80%A3%E3%83%AC%E3%82%B3%E3%83%BC%E3%83%89%E4%B8%80%E8%A6%A7%E5%86%85%E3%81%AE%E9%87%91%E9%A1%8D%E3%82%84%E6%95%B0%E5%80%A4%E3%82%92%E9%9B%86%E8%A8%88%E3%81%97/</guid>
            <description>&lt;h2 id=&#34;関連レコードに合計を表示したい&#34;&gt;関連レコードに合計を表示したい&#xA;&lt;/h2&gt;&lt;p&gt;Kintone（キントーン）で請求書や勤怠管理などで、明細を関連レコード一覧で表示するアプリを作成したのですが、金額や時間の合計を登録できたらな～と検索してみたら方法がありましたのでメモ。アプリにJavascriptを登録したら正常に動きました。&lt;/p&gt;&#xA;&lt;p&gt;関連レコード一覧を表示するアプリに「数値」パーツで作った「合計」というフィールドに、レコード保存時に計算された値が表示され、保存できました。しかし、最初のレコード保存では表示されず、&lt;strong&gt;２回目の保存のタイミング&lt;/strong&gt;で表示されるので、改善の余地ありです。&lt;/p&gt;&#xA;&lt;h3 id=&#34;ソース1&#34;&gt;ソース1&#xA;&lt;/h3&gt;&lt;p&gt;AAA1、AAA2、BBB、CCC、DDDをそれぞれアプリで使用している項目の&lt;strong&gt;フィールドコード&lt;/strong&gt;に置換て使用します。フィールドコードは英数に限らず日本語でも大丈夫です。&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;(function() {&#xA;  kintone.events.on([&amp;#39;app.record.edit.show&amp;#39;,&amp;#39;app.record.create.change.AAA2&amp;#39;], function(event) {&#xA;    const appId = kintone.app.getRelatedRecordsTargetAppId(&amp;#34;BBB&amp;#34;);&#xA;    const query = &amp;#39;AAA1=&amp;#34;&amp;#39; + event.record[&amp;#39;AAA2&amp;#39;].value + &amp;#39;&amp;#34;&amp;#39;; &#xA;    const body = {&#xA;      &amp;#39;app&amp;#39; : appId,&#xA;      &amp;#39;query&amp;#39; : query&#xA;    };&#xA;    kintone.api(kintone.api.url(&amp;#39;/k/v1/records&amp;#39;, true), &amp;#39;GET&amp;#39;, body, function(resp) {&#xA;      var sum = 0;&#xA;      resp.records.forEach((record)=&amp;gt;{&#xA;        sum += record[&amp;#39;CCC&amp;#39;].value ? parseInt(record[&amp;#39;CCC&amp;#39;].value) : 0;&#xA;      });&#xA;       event.record[&amp;#39;DDD&amp;#39;].value = sum;&#xA;       kintone.app.record.set(event);&#xA;    });&#xA;&#xA;    return event;&#xA;  });  &#xA;  &#xA;})();&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h4 id=&#34;設定するフィールドコードの説明&#34;&gt;設定するフィールドコードの説明&#xA;&lt;/h4&gt;&lt;p&gt;例えば、リレーションの関係が請求書アプリと請求書明細アプリだったとしたら、以下のようになります。&lt;/p&gt;&#xA;&lt;p&gt;AAA1&lt;/p&gt;&#xA;&lt;p&gt;「関連レコード一覧」の設定で「表示するレコードの条件」に設定している&lt;strong&gt;主キー&lt;/strong&gt;となるフィールドコード（関連レコード一覧を&lt;strong&gt;呼び出すアプリ側&lt;/strong&gt;のフィールドコード）。&lt;/p&gt;&#xA;&lt;p&gt;（例）請求書アプリ側の請求書ID（レコードID）&lt;/p&gt;&#xA;&lt;p&gt;AAA2&lt;/p&gt;&#xA;&lt;p&gt;「関連レコード一覧」の設定で「表示するレコードの条件」に設定している&lt;strong&gt;外部キー&lt;/strong&gt;となるフィールドコード（関連レコード一覧に&lt;strong&gt;呼び出されるアプリ側&lt;/strong&gt;のフィールドコード）。&lt;/p&gt;&#xA;&lt;p&gt;（例）請求書明細アプリ側の請求書ID&lt;/p&gt;&#xA;&lt;p&gt;BBB&lt;/p&gt;&#xA;&lt;p&gt;「関連レコード一覧」&lt;strong&gt;パーツ&lt;/strong&gt;に設定したフィールドコード（関連レコード一覧を&lt;strong&gt;呼び出す****アプリ側&lt;/strong&gt;のフィールドコード）。&lt;/p&gt;&#xA;&lt;p&gt;（例）請求書アプリ側の明細を表示する「関連レコード一覧」パーツのフィールドコード&lt;/p&gt;&#xA;&lt;p&gt;CCC&lt;/p&gt;&#xA;&lt;p&gt;関連レコード一覧に&lt;strong&gt;呼び出されるアプリ側&lt;/strong&gt;にある集計対象のフィールドコード。&lt;/p&gt;&#xA;&lt;p&gt;（例）請求書明細アプリ側の「金額」フィールド&lt;/p&gt;&#xA;&lt;p&gt;DDD&lt;/p&gt;&#xA;&lt;p&gt;集計結果を表示したいパーツのフィールドコード（関連レコード一覧を&lt;strong&gt;呼び出す****アプリ側&lt;/strong&gt;のフィールドコード）。&lt;/p&gt;&#xA;&lt;p&gt;（例）請求書アプリ側の「合計」フィールドコード&lt;/p&gt;&#xA;&lt;h3 id=&#34;ソース2&#34;&gt;ソース2&#xA;&lt;/h3&gt;&lt;p&gt;以下のソースでも動作しました。こちらの方がわかりやすいかもしれません。&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;(() =&amp;gt; {&#xA;    &amp;#39;use strict&amp;#39;;&#xA;  &#xA;    const events = [&#xA;      &amp;#39;app.record.detail.show&amp;#39;,&#xA;      &amp;#39;app.record.edit.show&amp;#39;&#xA;    ];&#xA;    kintone.events.on(events, (event) =&amp;gt; {&#xA;      const clientRecordId = event.recordId;&#xA;      const relatedAppId = kintone.app.getRelatedRecordsTargetAppId(&amp;#39;請求明細一覧&amp;#39;);&#xA;      const query = &amp;#39;請求書ID=&amp;#34;&amp;#39; + event.record[&amp;#39;請求書ID&amp;#39;].value + &amp;#39;&amp;#34;&amp;#39;;&#xA;      // const query = `&amp;#34;${clientRecordId}&amp;#34;=請求書ID`; //レコードIDを使用する場合&#xA;      const outputFields = [&amp;#39;金額&amp;#39;];&#xA;      const appUrl = kintone.api.url(&amp;#39;/k/v1/records&amp;#39;);&#xA;  &#xA;      const params = {&#xA;        &amp;#39;app&amp;#39;: relatedAppId,&#xA;        &amp;#39;query&amp;#39;: query,&#xA;        &amp;#39;fields&amp;#39;: outputFields&#xA;      };&#xA;    &#xA;      kintone.api(appUrl, &amp;#39;GET&amp;#39;, params, (resp) =&amp;gt; {&#xA;        let amount = 0;&#xA;        for (let i = 0; i &amp;lt; resp.records.length; i++) {&#xA;          //amount += parseFloat(resp.records[i].金額.value);&#xA;          amount += parseFloat(resp.records[i].金額.value) ? parseFloat(resp.records[i].金額.value) : 0;&#xA;        }&#xA;&#xA;        event.record[&amp;#39;合計&amp;#39;].value = amount;&#xA;        kintone.app.record.set(event);&#xA;        return event;&#xA;      });&#xA;    });&#xA;  })();&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;参考サイト&#34;&gt;参考サイト&#xA;&lt;/h2&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://developer.cybozu.io/hc/ja/articles/203030394-%E9%96%A2%E9%80%A3%E3%83%AC%E3%82%B3%E3%83%BC%E3%83%89%E3%81%AE%E9%A0%85%E7%9B%AE%E3%82%92%E6%9D%A1%E4%BB%B6%E4%BB%98%E3%81%8D%E3%81%A7%E9%9B%86%E8%A8%88&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://developer.cybozu.io/hc/ja/articles/203030394-%E9%96%A2%E9%80%A3%E3%83%AC%E3%82%B3%E3%83%BC%E3%83%89%E3%81%AE%E9%A0%85%E7%9B%AE%E3%82%92%E6%9D%A1%E4%BB%B6%E4%BB%98%E3%81%8D%E3%81%A7%E9%9B%86%E8%A8%88&#34; alt=&#34;https://developer.cybozu.io/hc/ja/articles/203030394-%E9%96%A2%E9%80%A3%E3%83%AC%E3%82%B3%E3%83%BC%E3%83%89%E3%81%AE%E9%A0%85%E7%9B%AE%E3%82%92%E6%9D%A1%E4%BB%B6%E4%BB%98%E3%81%8D%E3%81%A7%E9%9B%86%E8%A8%88&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://developer.cybozu.io/hc/ja/articles/203030394-%E9%96%A2%E9%80%A3%E3%83%AC%E3%82%B3%E3%83%BC%E3%83%89%E3%81%AE%E9%A0%85%E7%9B%AE%E3%82%92%E6%9D%A1%E4%BB%B6%E4%BB%98%E3%81%8D%E3%81%A7%E9%9B%86%E8%A8%88&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://developer.cybozu.io/hc/ja/articles/203030394-%E9%96%A2%E9%80%A3%E3%83%AC%E3%82%B3%E3%83%BC%E3%83%89%E3%81%AE%E9%A0%85%E7%9B%AE%E3%82%92%E6%9D%A1%E4%BB%B6%E4%BB%98%E3%81%8D%E3%81%A7%E9%9B%86%E8%A8%88&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://fastsystem.funai.site/relatedrecords-sum/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://fastsystem.funai.site/relatedrecords-sum/&#34; alt=&#34;https://fastsystem.funai.site/relatedrecords-sum/&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://fastsystem.funai.site/relatedrecords-sum/&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://fastsystem.funai.site/relatedrecords-sum/&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://www.gotop.co.jp/kintonesi20220113/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://www.gotop.co.jp/kintonesi20220113/&#34; alt=&#34;https://www.gotop.co.jp/kintonesi20220113/&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://www.gotop.co.jp/kintonesi20220113/&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://www.gotop.co.jp/kintonesi20220113/&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;</description>
        </item><item>
            <title>新型コロナウィルス感染者数の調査・集計に役立ちそうなダッシュボードサイトのメモ</title>
            <link>https://qwerty.work/post/2022/01/covid19-dashboad/</link>
            <pubDate>Tue, 11 Jan 2022 20:01:41 +0900</pubDate>
            <guid>https://qwerty.work/post/2022/01/covid19-dashboad/</guid>
            <description>&lt;h2 id=&#34;気になる新型コロナウィルスの感染者数とその内訳&#34;&gt;気になる新型コロナウィルスの感染者数とその内訳&#xA;&lt;/h2&gt;&lt;p&gt;毎日、本日の感染者数は東京都で何人で、沖縄県では何人と、テレビや新聞、ネットのニュースで報道されていますが、新規感染者数よりも、もっと知りたい数があります。&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;新規感染者のうち、ワクチン接種済みの人数と割合&lt;/li&gt;&#xA;&lt;li&gt;重傷者数の人数と割合&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;これに関する報道がないですよね？そこで、どう集計していいかよくわかりませんが、参考になりそうなページをとりあえずメモ。&lt;/p&gt;&#xA;&lt;h2 id=&#34;いろいろなコロナ関連のダッシュボード&#34;&gt;いろいろなコロナ関連のダッシュボード&#xA;&lt;/h2&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://corona.go.jp/dashboard/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://corona.go.jp/dashboard/&#34; alt=&#34;https://corona.go.jp/dashboard/&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://corona.go.jp/dashboard/&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://corona.go.jp/dashboard/&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://www.stopcovid19.jp/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://www.stopcovid19.jp/&#34; alt=&#34;https://www.stopcovid19.jp/&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://www.stopcovid19.jp/&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://www.stopcovid19.jp/&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://vdata.nikkei.com/newsgraphics/coronavirus-world-map/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://vdata.nikkei.com/newsgraphics/coronavirus-world-map/&#34; alt=&#34;https://vdata.nikkei.com/newsgraphics/coronavirus-world-map/&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://vdata.nikkei.com/newsgraphics/coronavirus-world-map/&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://vdata.nikkei.com/newsgraphics/coronavirus-world-map/&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://coromap.info/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://coromap.info/&#34; alt=&#34;https://coromap.info/&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://coromap.info/&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://coromap.info/&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://www3.nhk.or.jp/news/special/coronavirus/data/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://www3.nhk.or.jp/news/special/coronavirus/data/&#34; alt=&#34;https://www3.nhk.or.jp/news/special/coronavirus/data/&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://www3.nhk.or.jp/news/special/coronavirus/data/&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://www3.nhk.or.jp/news/special/coronavirus/data/&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;h2 id=&#34;厚生労働省のページ&#34;&gt;厚生労働省のページ&#xA;&lt;/h2&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://www.mhlw.go.jp/stf/covid-19/kokunainohasseijoukyou.htm&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://www.mhlw.go.jp/stf/covid-19/kokunainohasseijoukyou.htm&#34; alt=&#34;https://www.mhlw.go.jp/stf/covid-19/kokunainohasseijoukyou.htm&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://www.mhlw.go.jp/stf/covid-19/kokunainohasseijoukyou.htm&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://www.mhlw.go.jp/stf/covid-19/kokunainohasseijoukyou.htm&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://www.mhlw.go.jp/stf/covid-19/open-data.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://www.mhlw.go.jp/stf/covid-19/open-data.html&#34; alt=&#34;https://www.mhlw.go.jp/stf/covid-19/open-data.html&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://www.mhlw.go.jp/stf/covid-19/open-data.html&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://www.mhlw.go.jp/stf/covid-19/open-data.html&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;h2 id=&#34;都道府県別ダッシュボードとオープンデータ&#34;&gt;都道府県別ダッシュボードとオープンデータ&#xA;&lt;/h2&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://stopcovid19.metro.tokyo.lg.jp/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://stopcovid19.metro.tokyo.lg.jp/&#34; alt=&#34;https://stopcovid19.metro.tokyo.lg.jp/&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://stopcovid19.metro.tokyo.lg.jp/&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://stopcovid19.metro.tokyo.lg.jp/&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://yamaguchi.stopcovid19.jp/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://yamaguchi.stopcovid19.jp/&#34; alt=&#34;https://yamaguchi.stopcovid19.jp/&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://yamaguchi.stopcovid19.jp/&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://yamaguchi.stopcovid19.jp/&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://yamaguchi-opendata.jp/ckan/dataset/350001-covid19&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://yamaguchi-opendata.jp/ckan/dataset/350001-covid19&#34; alt=&#34;https://yamaguchi-opendata.jp/ckan/dataset/350001-covid19&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://yamaguchi-opendata.jp/ckan/dataset/350001-covid19&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://yamaguchi-opendata.jp/ckan/dataset/350001-covid19&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;</description>
        </item><item>
            <title>エクセルでSUMPRODUCT関数を使って特定の文字列を含むものをカウントする</title>
            <link>https://qwerty.work/post/2017/03/excel-sumproduct-isnumber-find/</link>
            <pubDate>Wed, 22 Mar 2017 19:43:52 +0900</pubDate>
            <guid>https://qwerty.work/post/2017/03/excel-sumproduct-isnumber-find/</guid>
            <description>&lt;p&gt;エクセルで数や金額のの集計をする場合、単純な条件であれば&lt;strong&gt;SUMIF&lt;/strong&gt;や&lt;strong&gt;COUNTIF&lt;/strong&gt;でいいのですが、複数の条件にマッチする集計の場合はいつも&lt;strong&gt;SUMPRODUCT関数&lt;/strong&gt;を使っています。&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;SUMPRODUCT関数&lt;/strong&gt;では**&amp;quot;*&amp;quot;**などのワイルドカードで特定の文字を指定ができず不便でしかたありません。&lt;/p&gt;&#xA;&lt;p&gt;ところがいろいろ検索したら&lt;strong&gt;SUMPRODUCT関数&lt;/strong&gt;で&lt;strong&gt;ワイルドカードを使わなくても&lt;/strong&gt;特定の文字を含む文字列をカウントする方法があったのでメモ。&lt;/p&gt;&#xA;&lt;h3 id=&#34;isnumberとfind関数を併用&#34;&gt;ISNUMBERとFIND関数を併用&#xA;&lt;/h3&gt;&lt;p&gt;以下の表を参考にした場合。&lt;/p&gt;&#xA;&lt;p&gt;&lt;img class=&#34;gallery-image&#34; data-flex-basis=&#34;528px&#34; data-flex-grow=&#34;220&#34; height=&#34;393&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2017/03/excel-sumproduct-isnumber-find/images/No-00.jpg&#34; srcset=&#34;https://qwerty.work/post/2017/03/excel-sumproduct-isnumber-find/images/No-00_hu_d65e33af8f541da8.jpg 800w, https://qwerty.work/post/2017/03/excel-sumproduct-isnumber-find/images/No-00.jpg 866w&#34; width=&#34;866&#34;&gt;&lt;/p&gt;&#xA;&lt;h4 id=&#34;特定の文字を含む文字列をカウント&#34;&gt;特定の文字を含む文字列をカウント&#xA;&lt;/h4&gt;&lt;p&gt;例えば、メモ欄に「リンゴ」が&lt;strong&gt;含まれている&lt;/strong&gt;「セット商品」をカウントする場合の計算式は以下のようになります。&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=SUMPRODUCT((B2:B6=&amp;#34;セット商品&amp;#34;)*(ISNUMBER(FIND(&amp;#34;リンゴ&amp;#34;,C2:C6))))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h4 id=&#34;特定の文字を含まない文字列をカウント&#34;&gt;特定の文字を含まない文字列をカウント&#xA;&lt;/h4&gt;&lt;p&gt;逆に「リンゴ」が&lt;strong&gt;含まれていない&lt;/strong&gt;「セット商品」をカウントしたい場合は&lt;strong&gt;NOT関数&lt;/strong&gt;を挿入します。&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=SUMPRODUCT((B2:B6=&amp;#34;セット商品&amp;#34;)*(NOT(ISNUMBER(FIND(&amp;#34;リンゴ&amp;#34;,C2:C6)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;サンプルファイル&#34;&gt;サンプルファイル&#xA;&lt;/h3&gt;&lt;p&gt;&lt;a class=&#34;link&#34; href=&#34;https://qwerty.work/blog/2017/03/22/sample1.zip&#34; &gt;sample1.zip&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;XLSファイルをZIPで圧縮しています。&lt;/p&gt;&#xA;&lt;h3 id=&#34;その他方法&#34;&gt;その他方法&#xA;&lt;/h3&gt;&lt;p&gt;以下の方法でも同じカウントができました。&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=COUNT(INDEX(0/SEARCH(&amp;#34;セット商品*リンゴ*&amp;#34;,B2:B6&amp;amp;C2:C6),))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=COUNT(INDEX(SEARCH(&amp;#34;セット商品_*リンゴ*&amp;#34;,B2:B6&amp;amp;&amp;#34;_&amp;#34;&amp;amp;C2:C6),))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;エクセルは奥が深いですね。&lt;/p&gt;&#xA;</description>
        </item></channel>
</rss>
