# 回数を複数月で集計した値をヒストグラムで表現したいが重複行が発生してしまう

**URL:** <https://community.amazonquick.com/t/topic/37347>\
**Category:** 日本語で質問 | Q&A\
**Tags:** Japanese, analysis, Business-Intelligence-Engineer, quick-sight\
**Created:** [October 23, 2024, 7:29am UTC](https://community.amazonquick.com/t/topic/37347 "2024-10-23T07:29:34Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![mririka](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@mririka](https://community.amazonquick.com/u/mririka)\
**Post date:** [October 23, 2024, 11:00am UTC](https://community.amazonquick.com/t/topic/37347/2 "2024-10-23T11:00:05Z")

</div>

@kawasakitr222 様

ご質問いただきありがとうございます。

ヒストグラムは、数値フィールドの分布を表現できますが、その数値データの（バケット化した）絶対数を使用します。

> **[ヒストグラムの使用 - Amazon QuickSight](https://docs.aws.amazon.com/ja_jp/quicksight/latest/user/histogram-charts.html)**
>
> Amazon でヒストグラムのビジュアルタイプを使用します QuickSight。

代替案としては、以下のような Count を ID ごとに合計する計算フィールド pre\_sumOver を作成し、

```auto
sumOver(Count, [ID], PRE_AGG)

```

Count の合計をバケット分類する以下のような計算フィールド bucket を作成します。

```auto
ifelse(
    {pre_sumOver} <= 15, '0-15',
    {pre_sumOver} <= 30, '16-30',
    {pre_sumOver} <= 45, '31-45',
    {pre_sumOver} <= 60, '46-60',
    {pre_sumOver} <= 75, '61-75',
    '76-'
)

```

そして、垂直棒グラフの X 軸に bucket 、グループ/色 に ID、値に ID (個別の値をカウント)を設定することで、棒グラフを作成することが可能です。

 ![qscommunity_1023](https://d1wl4jav5dp96l.cloudfront.net/original/3X/4/5/457229db84c5ae85a17b33b1633a378bca847900.png)

---

_[View the full topic](https://community.amazonquick.com/t/topic/37347)._
