0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

rex0220 計算式プラグイン 売上金額の担当分割(複数担当者)

Last updated at Posted at 2025-06-14

計算式プラグインで、売上金額を複数担当者に分割して、グラフ集計してみます。
rex0220 計算式プラグイン 売上金額の担当分割の複数担当者対応版です。

概要

担当毎(AA担当・BB担当)にそれぞれ複数担当者を割り当てて、金額を分割します。
端数は、先頭の担当者に割り当てます。

  • 編集画面

2025-06-14_10h36_27.png

  • 区分別担当別クロス集計

2025-06-14_16h46_36.png

  • グラフ集計: テーブルを担当・区分別に積み上げ表示

2025-06-14_10h43_12.png

  • カスタム一覧で、集計・積み上げグラフを表示

2025-06-14_16h45_46.png

計算式プラグイン設定

端数を先頭の担当者に割り当てる計算式:
leader, total - base * (num - 1)

2025-06-14_10h44_24.png

OPTION: 

// AA担当分 NUMBER
CEIL(売上金額/2)

// BB担当分 NUMBER
売上金額-AA担当分

// テーブル SUBTABLE
TABLE_DATA(
  LET( // AA担当分集計
    total, AA担当分, // AA合計
    num, ARRAY_COUNT(AA担当), // 人数取得
    base, FLOOR(total / num), // 均等分割
    leader, total - base * (num - 1), // 代表金額
    ARRAY_MAP(AA担当, xx, idx,
      DIC(
        "区分", "AA担当", // 区分設定
        "担当", ARRAY(xx), // 担当者
        "金額", IF(idx=0, leader, base) // 金額配分
      )
    )
  ),
  LET( // BB担当分集計
    total, BB担当分, // BB合計
    num, ARRAY_COUNT(BB担当), // 人数取得
    base, FLOOR(total / num), // 均等分割
    leader, total - base * (num - 1), // 代表金額
    ARRAY_MAP(BB担当, xx, idx,
      DIC(
        "区分", "BB担当", // 区分設定
        "担当", ARRAY(xx), // 担当者
        "金額", IF(idx=0, leader, base) // 金額配分
      )
    )
  )
)

// テーブル.区分 DROP_DOWN
// テーブル.担当 USER_SELECT
// テーブル.金額 NUMBER
0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?