ความแตกต่างระหว่าง Aggregate กับ non-Aggregate

Ann D
G-Able
Published in
Oct 5, 2023

Aggregate ใน Tableau คือ การรวมค่า โดยสามารถใช้ฟังก์ชันการรวมต่างๆ เช่น SUM(), AVG(), MIN(), MAX(), COUNT(), COUNTD() เป็นต้น สามารถใช้ฟังก์ชัน Aggregate ในข้อมูล measures หรือ dimension ได้
Non-Aggregate ใน Tableau คือ ไม่ใช่ค่ารวม, ค่าของข้อมูลในแต่ละ records

ตัวอย่างเช่นในกรณีคำนวณ Profit Ratio แยกตาม Sub-Category ผลที่ได้ของ Profit Ratio และ Profit Ratio (Non) จะไม่เหมือนกัน

Photo by me
Profit Ratio and Profit Ratio (Non) by Sub-Category

Profit Ratio เป็นการคำนวณจาก sum ค่า Profit และค่า Sales มาหารกัน SUM([Profit]) / SUM([Sales]) *ตั้งค่าให้แสดงผลเป็น %

Profit Ratio Calculation
Test
Profit Ratio ที่เป็น Aggregate

Profit Ratio (Non) เป็นการคำนวณจาก Profit และ Sales มาหารกัน
[Profit] / [Sales] *ตั้งค่าให้แสดงผลเป็น %

Profit Ratio (Non)
Profit Ratio ที่เป็น Non-Aggregate

ผลที่ได้ ตัวอย่าง Sub-Category “Accessories”

Profit Ratio = 24.88%

เกิดจาก sum ข้อมูล Accessories แล้วนำมาคำนวณ

25,337 / 101,842 => 24.88%

Profit Ratio (Non) = 49.21%

เกิดจากข้อมูลมี Accessories 2 records จะทำการคำนวณตามบรรทัดข้อมูลเลย

9,664 / 41,896 => 23.07%
15,672 / 59,946 => 26.14%
23.07% + 26.14% = 49.21%

การแสดงผลขึ้นกับการวางค่าที่หน้ากราฟ

จากตัวอย่าง Aggregate คือทำ sum ข้อมูลตาม Sub-Category ก่อนนำมาหาร
non- Aggregate คือ หาร by record ข้อมูลก่อนนำมา sum ตาม Sub-Category

--

--