58
เคราะอลวย Pivot Table Pivot Table ในบางสไลอาจเยนอเน PT ภาพประกอบวนใหมาจากหงอ Microsoft Excel 2016 PIVOT TABLE DATA CRUNCHING โดย Bill Jelen, Michael Alexander IS216 ผศ.วันชัย ขันตี

PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

วิเคราะห์ข้อมูลด้วย Pivot Table

Pivot Table ในบางสไลด์อาจเขียนย่อเป็น PT

ภาพประกอบส่วนใหญ่มาจากหนังสือ Microsoft Excel 2016 PIVOT TABLE DATA CRUNCHING

โดย Bill Jelen, Michael Alexander

IS216

ผศ.วันชัย ขันตี

Page 2: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Pivot Table2

PivotTables summarize and analyze large amounts of data into summary reports.

Pivot Table จะช่วยสรุปและวิเคราะห์ข้อมูลขนาดใหญ่ให้อยู่ในรูปของรายงานสรุปโดยไม่ต้องทำอะไรมาก

Summarize your information in just a few clicks

Page 3: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

จะใช้ Pivot Table เมื่อไหร่• เมื่อมีข้อมูลการทำรายการ (transactional data) เป็นจำนวน

มากซึ่งเร่ิมทำให้นำไปสรุปหรือวิเคราะห์ได้ยากยิ่งขึ้นเรื่อย ๆ

• ต้องการสรุปข้อมูลเป็นกลุ่ม ๆ

• ต้องการหาแนวโน้มจากข้อมูลตามช่วงเวลาต่าง ๆ

• ต้องการสร้างผลรวมย่อย (subtotal) ซึ่งมักมีกลุ่มรายการใหม่เพิ่มมาอยู่เรื่อย ๆ

• เมื่อต้องการจัดระเบียบข้อมูลให้อยู่ในรูปที่จะนำไปสร้างแผนภูมิ (chart) ต่าง ๆ ได้ง่าย

3

Page 4: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

พื้นที่บน Pivot Tableพื้นที่ของ Pivot Table แบ่งออกเป็น 4 ส่วนดังนี้

• Values Area - แสดงข้อมูลที่ได้จากการคำนวณ

• Rows Area - หัวบรรทัด สามารถคลิกเลือกระดับชั้นข้อมูลที่ต้องการดูได้

• Column Area - หัวคอลัมน์

• Filter Area - สำหรับแสดงตัวกรอง (ถ้ามี)

4

Page 5: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Values Area5

พื้นที่แสดงค่าข้อมูลที่ได้จากการคำนวณ

Page 6: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Rows Area6

Rows Area มักประกอบด้วยหัวบรรทัดอย่างน้อย 1 ฟิลด์ แต่จะไม่มีเลยก็ได้ อาจมีปุ่ม +/- ให้คลิกเพื่อ ขยาย/ยุบ บรรทัดในระดับชั้นรองลงไป (เรียกว่า Drill Down)

Page 7: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Columns Area7

Columns Area ประกอบด้วยหัว(heading) ครอบคลุมทุกคอลัมน์ของ Pivot Table

Page 8: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Filters Area8

Filters Area ชุดของ drop down อยู่ด้านบนซ้ายของ Pivot Table แสดงการตั้งค่าตัวกรอง จะแสดงก็ต่อเมื่อมีการใช้ตัวกรอง

Page 9: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

เตรียมสร้าง Pivot Table• ข้อมูลที่จะนำมาสร้าง Pivot Table ควรจัดเรียงในรูปของตาราง (ทำนองเดียว

กับตารางของฐานข้อมูล)

• ไม่มีบรรทัดหรือคอลัมน์ว่าง

• แต่ละคอลัมน์จะต้องมีหัว (heading - ชื่อคอลัมน์หรือชื่อฟิลด์) เพียงบรรทัดเดียว

• แต่ละฟิลด์ (field) จะต้องมีค่าในทุกบรรทัด ไม่ควรมีเซลว่าง

• จะต้องมีข้อมูลเป็นตัวเลขรวมอยู่ด้วย

• ชื่อคอลัมน์ห้ามซ้ำกัน

• คอลัมน์ต่าง ๆ ต้องไม่บรรจุกลุ่มข้อมูลที่ซ้ำกัน (ข้อมูลเรื่องเดียวกันไม่ควรมีหลายคอลัมน์)

9

Page 10: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

ตัวอย่างข้อมูลที่ไม่เหมาะ10

มีการจัดข้อมูฃให้ดูง่าย แต่ไม่เหมาะที่จะนำไปสร้าง Pivot Table ควรแก้ที่ใดบ้างเพื่อให้ข้อมูลชุดนี้เหมาะแก่การนำไปสร้าง Pivot Table

Page 11: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

ตัวอย่างข้อมูลที่เหมาะ11

Page 12: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

วิธีสร้าง Pivot Table12

จากแท็บ Insert คลิกสัญรูป Pivot Table จะปรากฏหน้าต่าง Create Pivot Table ขึ้น มาถาม 2 เรื่องหลักคือ 1. จะใช้ข้อมูลจากที่ใด 2. จะสร้าง pivot table ไว้ที่ใด

เชื่อมต่อกับแหล่งข้อมูลภายนอก (นอกเหนือขอบเขตวิชานี้ ไม่ต้องทำ)

เลือกว่าจะสร้างรายงาน PivotTable ไว้ที่ใด จะสร้างใน worksheet ใหม่ หรือ แทรกไว้ใน worksheet ปัจจุบัน

ถ้าเลือก range ของเซลมาก่อนแล้ว จะแสดงที่นี่ ถ้าไม่ได้เลือกมาก่อน ช่องนี้จะว่างให้คลิกที่สัญรูป เพื่อระบุ range ซึ่งอาจกรอกลงไปหรือเลือก range จาก worksheet ก็ได้ (ต้องรวมหัวเข้าไปด้วย)

Create Pivot Table Dialog You can also press the shortcut Alt+N+V to start a pivot table.

คลิก OK เพื่อลงมือสร้าง Pivot Table

Page 13: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

วิธีสร้าง Pivot Table (ต่อ)13

Excel จะสร้าง Pivot Table ว่างใน worksheet ใหม่ หรือใน worksheet เดิมตามที่เลือกไว้ แล้วแสดงแท็บ Analyze ของ PivotTable Tools

พื้นที่ Pivot Table ที่สร้างขึ้นใหม่

สำหรับแสดงข้อมูลต่าง ๆ จะเรียกว่ารายงาน

(Pivot Table Report) ก็ได้ เพราะสามารถดูข้อมูลได้แต่

แก้ไขไม่ได้

Page 14: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

วิธีสร้าง Pivot Table (ต่อ)14

พื้นที่ Pivot Table ที่สร้างขึ้นใหม่

PivotTable Fields Panel สำหรับเลือกฟิลด์ที่จะนำมาใส่ ในรายงาน จะอยู่ด้านขวาสุด จะแสดงก็ต่อเมื่อ พื้นที่ Pivot Table ถูกเลือก

รายชื่อฟิลด์สำหรับติ๊กเลือก ไปใช้ในรายงาน

พื้นที่ที่จะลากฟิลด์มาวาง แบ่งเป็น 4 ส่วน

Page 15: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

เพิ่มฟิลด์ลงในรายงานสามารถลากฟิลด์มาวางลงในพื้นที่ซึ่งแบ่งเป็น 4 ช่อง ดังนี้

1. FILTERS - ฟิลด์ที่จะนำมาใช้ในการกรองข้อมูล

2. COLUMNS - ฟิลด์ที่จะนำมาสร้างเป็นคอลัมน์ในรายงาน

3. ROWS - ฟิลด์ที่จะสร้างเป็นบรรทัดในรายงาน

4. VALUES - ฟิลด์ที่จะนำมาคำนวณ (default คือ Sum)

15

Page 16: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

เพิ่มฟิลด์ลงในรายงาน (ต่อ)16

แค่ติ๊กฟิลด์ที่จะนำไปใช้ Excel จะอำนวยความสะดวกโดยเลือกให้เองว่า จะนำฟิลด์นั้นไปเพิ่มลงในรายงาน Pivot Table บริเวณพื้นที่ใด

• ถ้าฟิลด์เป็น Text จะใส่ไว้ใน ROWS • ถ้าฟิลด์เป็น Numeric จะใส่ไว้ใน VALUES

(ถ้ามีเซลใดเป็น blank จะถือว่าฟิลด์นั้นเป็น Text)

ถ้าเราอยากเลือกเอง ให้ใช้วิธีลากไปวาง

จากรูปตวัอยา่ง มีการติ2กเลอืก Region ซึ>งเป็น Text Excel จะเลอืกไปใสใ่น ROWS Area ให้เอง

Page 17: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

เพิ่มฟิลด์ลงในรายงาน (ต่อ)17

จากรูป ตอ่มามีการติ2กเลอืก Sale Amount เพิ>ม ซึ>งเป็น Numeric

Excel จะเลอืกไปใสใ่น VALUES Area ให้เอง ซึ>งจะเพิ>มเป็นคอลมัน์ Sum of Sale Amount

ใน Values Area

Page 18: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

การเพิ่มชั้น (layer) ข้อมูล18

ตวัอยา่งนีต้̂องการเพิ>มการดยูอดขายของแตล่ะผลติภณัฑ์ จงึติ2ก Product Category ซึ>งเป็น Text จงึเป็นการเพิ>มลงใน Rows Area เป็นรายการยอ่ยอีกชัน̂ภายใต้ Region

Page 19: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Rearranging a Pivot Table19

ถ้าอยากดู Pivot Table ในมุมมองอื่นที่ต่างไปจากเดิม

สามารถลากเพื่อย้ายฟิลด์ จาก พื้นที่หนึ่งไปไว้อีกพื้นที่ได้

หรือ

ลากจากรายชื่อฟิลด์ที่เราติ๊กไว้ก่อนหน้านี้ไปไว้ใน Area ใหม่ มันจะลบออกจาก

area เดิมให้

หรือ

คลิกที่ context menu แล้วเลือกจากเมนูว่าจะย้ายไปไว้ใน area ใด

Context Menu

Page 20: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Rearranging a Pivot Table (ต่อ)20

ตัวอย่าง Pivot Table ที่จัดใหม่ ย้าย Product Category จาก Row Area ไปไว้ที่ Column Area

สังเกตุตรง Column Labels มี Context Menu ให้เลือกว่าจะเรียงชื่อคอลัมน์อย่างไร (Sort A to Z, Sort Z to A) และให้เลือกว่าจะนำค่าข้อมูลใดมาเป็นหัวคอลัมน์บ้าง

Page 21: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

การใช้ตัวกรอง21

ถ้าไม่ต้องการนำข้อมูลทั้งหมดมาวิเคราะห์ สามารถนำตัวกรองมาคัดข้อมูลให้เหลือเฉพาะที่สนใจ

ตัวอย่างนี้ลากฟิลด์ Region มาวางไว้ใน FILTERS Area Region จะถูกย้ายออกจาก Rows Area ไปอยู่ใน Filter Area จะมี Drop down list สัญรูปกรวย ให้คลิกเพื่อเลือกว่าจะนำข้อมูล region ใดมาใช้บ้าง

Filters Area

Page 22: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

The ribbon for Pivot Tables22

มี 2 แท็บย่อย Analyze กับ Design ต้องมีการคลิกเลือกพื้นที่ใน Pivot Table มาก่อนจึงจะแสดง riboon นี้

Page 23: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

การใช้ตัวเฉือน (Slicer)23

ตัวเฉือน ช่วยให้ตั้งค่าการกรองได้สะดวกขึ้น

คลิกสัญรูป Slicer เพื่อสร้าง Slicer จะเปิด Insert Slicers Dialog ให้เลือกว่าจะนำฟิลด์ใดบ้างมาใช้ในการเฉือน

เลือกฟิลด์จาก Insert Slicers Dialog เพื่อมาสร้างเป็นมิติที่ต้องการ วิเคราะห์ ตัวอย่างนี้เลือก 2 มิติ คือ Region กับ Market

Page 24: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

การใช้ตัวเฉือน (Slicer)24

หลังจากสร้าง slicers ขึ้นมาแล้ว สามารถเลือกค่าข้อมูลที่ต้องการดูจาก slicer แต่ละตัว

จากตัวอย่างมี slicer 2 ตัวคือ Region กับ Market

สามารถเลือกค่าข้อมูลได้หลายรายการ ด้วยการกด Ctrl ค้างไว้ขณะที่เลือก ตัวเลือกเพิ่ม

หรือ

ติ๊กตรง Multi-select เพื่อเปิดใช้ การเลือกหลายค่า (ดูสไลด์ถัดไป)

Page 25: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

การใช้ตัวเฉือน (Slicer) (ต่อ)25

คลิกเปิด Multi-Select หลังจากนั้นสามารถเลือก

ค่าจาก slicer ได้หลายค่า โดยไม่ต้องกด

Ctrl ค้างไว้

Clear Filter Toggle

Clear Filter Toggle จะ active ถ้ามีการเลือก บางรายการ คลิกปุ่มนี้ เพื่อยกเลิกการกรอง

Page 26: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

วิธีลบตัวเฉือนเมื่อไม่ต้องการใช้ตัวเฉือน สามารถลบมันออกไปได้ด้วยวิธีการใดวิธีหนึ่งต่อไปนี้

• คลิกเม้าส์ปุ่มขวา แล้วเลือก Remove “...” จากเมนู (ในเครื่องหมายคำพูดจะเป็นชื่อตัวเฉือน)

• คลิกในบริเวณตัวเฉือน แล้วกดปุ่ม Delete

หมายเหตุ ถึงจะลบตัวเฉือน ออกไปแล้ว ผลของมันยังอยู่ ถ้าสร้างตัวเฉือนตัวเดิมขึ้นมาอีกครั้ง ค่าต่าง ๆ ที่เลือกในตัวเฉือนจะยังคงเหมือนก่อนที่ถูกลบไป ถ้าไม่ต้องการให้การกรองจากตัวเฉือนมีผล ให้คลิก Clear Filter ก่อนลบตัวเฉือน

26

Page 27: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

การใช้ Timeline Slicer27

Timeline slicer is designed to work exclusively with date fields, and it provides an excellent visual method to filter and group the dates in a pivot table

คลิกสัญรูป Timeline จะเปิด Insert Timeline dialog ให้เลือกฟิลด์ที่เป็น date

เลือกฟิลด์ที่ต้องการใช้ในการเฉือน

Page 28: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

การใช้ Timeline Slicer (ต่อ)28

เลื่อนเพื่อเลือกเดือนที่ต้องการ

เลื่อนที่ขอบของตัวเลื่อนเพื่อขยายจำนวนเดือนที่จะเลือก

Page 29: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

การใช้ Timeline Slicer (ต่อ)29

คลิกเพื่อเลือกระยะเวลาที่ต้องการ

เลือกกรองเป็นราย ปี ไตรมาศ เดือน และวัน

Page 30: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Deferring Layout Updates30

เวลาคลิกเลือกฟิลด์ Excel จะไปควานหาค่าข้อมูลที่แตกต่างกันของฟิลด์นั้นมาแสดงทันที ถ้าข้อมูลมีเป็นจำนวนมาก จะใช้เวลานาน ทำให้ผู้ใช้รู้สึกรำคาญ

Excel version 2016 ได้เพิ่มความสามารถให้ชะลอการการควานหาข้อมูลมาแสดงไว้ก่อนได้ด้วยการติ๊กที่ Defer Layout Update

เราสามารถเลือกฟิลด์ต่าง ๆ หลายฟิลด์ แล้วค่อยคลิก UPDATE เมื่อต้องการ

Page 31: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Recommended Pivot Table 31

ช่วยให้ใช้ Pivot Table ได้เร็วขึ้น ด้วยการเลือก range ของข้อมูลที่ต้องการนำมาวิเคราะห์ แล้วคลิกสัญรูป Recommended Pivot Tables จะมี dialog ขึ้นมาให้เลือก Pivot Table ที่ Excel แนะนำ เมื่อเจอแบบที่ใช่ก็คลิก OK

Page 32: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

สรุปองค์ประกอบของ Pivot Table

32

Page 33: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Pivot Cache• Once you have created a Pivot Table, it doesn’t

automatically refresh when you add new data or change the existing data.

• Since your Pivot Table is created using the Pivot Cache, when the existing data changes or when you add new rows/columns to the data, the Pivot Cache does not update itself automatically, and hence, the Pivot Table also does not update.

• You need to force a refresh every time there are changes. Once you force a refresh, the Pivot Cache gets updated, which is reflected in the Pivot Table.

33

Page 34: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Refresh Pivot TableThis option is best suited when there are changes in the existing data source and you want to refresh the pivot table to reflect these changes.

• Right-click on any cell in the Pivot Table

• Select Refresh.

34

หรือใช้คีย์ลัด ALT + F5 หลังจากคลิกเลือกเซลใดก็ได้ใน

Pivot Table

Page 35: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Update Pivot Table by Changing the Data Source (1)If you’ve added new rows/columns to the data source, you need to change the data source to make sure new rows/columns are a part of the dataset.

• Select any cell in the Pivot Table.

• Go to Analyze –> Data –> Change Data Source.

This will select the data source that you have used and will open the ‘Change PivotTable Data Source’ dialog box.

35

Page 36: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Update Pivot Table by Changing the Data Source (2)• In the Change PivotTable Data Source dialog box,

update the range to include new data.

• Click OK

36

Note that if you use the Excel table to create the Pivot Table, you don’t need to use the change data source option. You can simply refresh the Pivot Table

and it’ll account for the new rows/columns.

Page 37: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Subtotals• Subtotal control allows you to toggle subtotals on

and off, as well as place them at the top or bottom of the section

• PivotTable Tools->design->Subtotals

37

Page 38: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Report Layout38

Compact Form Outline Form Tabular Form

มี 3 แบบ

(default)

Page 39: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

To change the layout1. Select a cell in the pivot

table.

2. On the Ribbon, under the PivotTable Tools tab, click the Design tab.

3. At the left, in the Layout group, click the Report Layout command

4. Click the layout that you want to uses

39

Page 40: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Compact Form40

Compact Form

Row Labels • Each Row label is in a separate row.

• The Row field label is always above the labels for the inner fields • Each Row label is slightly indented, from the field above it, to

differentiate the fields • The Row labels cannot be repeated. • The indentation can be changed, in PivotTable Options, on the

Layout & Format tab Row Fields • All the Row fields are in a single column. • There is a generic heading, Row Labels, in the Row Field

column Subtotals • Subtotals can be shown at the Top or Bottom of each group.

• This setting affects all the Row fields • For Column fields, Subtotals are always shown at the Bottom • The Row label remains at the top, even if Subtotals are at the

bottom

The Compact Form layout may be useful when you want to reduce the pivot table width, and aren't concerned about the Row field headings.

Page 41: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Outline Form41

Row Labels • Each Row label is in a separate row. • The Row field label is always above the labels for the inner

fields • The Row labels can be repeated.

Row Fields • Each Row field is in a separate column. • Each Row field shows its name in the column heading

Subtotals

• Subtotals can be shown at the Top or Bottom of each group. • This setting affects all the Row fields • For Column fields, Subtotals are always shown at the Bottom • The Row label remains at the top, even if Subtotals are at the

bottom

Outline Form

The Outline Form layout may be useful when you want to show all the field names as heading labels and aren't concerned about the width of the pivot table

Page 42: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Tabular Form42

Row Labels • Row labels for the outer fields are on the same row as

the first label for the related inner fields. • The Row labels can be repeated.

Row Fields • Each Row field is in a separate column. • Each Row field shows its name in the column heading

Subtotals • Subtotals can only be shown at the Bottom of each

group.

• This setting affects all the Row fields • For Column fields, Subtotals are always shown at the

BottomTabular Form

The Tabular Form layout may be useful when you want to show all the field names as heading labels and aren't concerned about the width of the pivot table but want to reduce the number of

rows

Page 43: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Repeat All Item Labels43

ปกติจะไม่แสดงรายการที่มีชื่อเหมือนกันซ้ำกัน แต่ถ้าต้องการให้แสดงให้เลือก “Repeat All Item Lables” ถ้าไม่ต้องการให้แสดงซ้ำเลือก

“Do not Repeat Item Labels”

Page 44: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Drill Down• double click on a Value Field, Excel will generate a

new sheet listing all the components in that fields.

44

Page 45: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Pivot ChartA pivot chart is a graphical representation of the data in a pivot table.

Page 46: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Creating a Pivot Chart• Click any cell inside pivot table

• Click the Insert tab on the ribbon

• On the Insert tab, you can see the Charts group displaying the various types of charts you can create

• choose the chart type you would like to use for your pivot chart

46

For this example, click the Column chart icon and select the first 2-D column chart

Page 47: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

47

Excel creates your pivot chart on the same sheet as your pivot table.

Creating a Pivot Chart

You can easily change the location of a pivot chart by right-clicking the chart (outside the plot area) and selecting Move Chart. This activates the Move Chart dialog, in which you can specify the new location.

Page 48: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Pivot Field Buttons48

Clicking Collapse Entire Field (−) on the chart collapses the data series and aggregates the data points. You can click Expand Entire Field (+) to drill back down to the Market level. These buttons enable you to interactively drill down or roll up the data shown in pivot charts.

You can also use slicers with pivot charts. Simply click a pivot chart, select the Analyze tab, and then click the Insert Slicer icon to take advantage of all the benefits of slicers with your pivot chart.

Page 49: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Using Conditional Formatting with Pivot Tables

49

ตัวอย่างนี้ เลือกการจัดรูปแบบตามเงื่อนไขแบบ Data Bars

Page 50: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Using Conditional Formatting with Pivot Tables

50

ปกติจะแสดงค่าข้อมูลควบคู่กับกราฟ ถ้าต้องการแสดงแต่กราฟ สามารถทำได้ดังนี้ 1.คลิก Conditional Formatting

drop-down บนแท็บ Home 2.เลือก Manage Rules 3.ที่ Rules Manager Dialog ให้เลือก data bar และเลือก Edit Rule

4.คลิก check box “Show Bar Only”

Page 51: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Using Conditional Formatting with Pivot Tables

51

ผลลัพธ์ที่ได้ ความยาวของกราฟแท่งจะสัมพันธ์กับค่าข้อมูล ตัวอย่างนี้แค่จัด format แต่ยังไม่ได้ตั้งเงื่อนไขในการแสดง

Page 52: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Preprogrammed Scenarios for Condition Levels

• Top Nth Items

• Image Top Nth %

• Image Bottom Nth Items

• Image Bottom Nth %

• Image Above Average

• Image Below Average

52

Page 53: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Creating Custom Conditional Formatting Rules

• ถ้าต้องการสร้างเงื่อนไขในการจัดรูปแบบเอง

• วาง cursor ไว้บนคอลัมน์ที่ต้องการ

• คลิกแท็บ Home

• เลือก Conditional Formatting

• เลือก New Rule

• จะปรากฏ New Formatting Rule dialog ให้ตั้งค่าต่าง ๆ

53

Page 54: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Creating Custom Conditional Formatting Rules

54

Page 55: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Creating Calculated Field• เปิด Calculated Field Dialog

56

Page 56: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Creating Calculated Field• จาก Insert Calculated Field Dialog ให้ใส่ชื่อฟิลด์ และ

สูตร ขณะใส่สูตร สามารถเลือกฟิลด์ต่าง ๆ จากด้านล่างมาแทรกในสูตรได้

57

Page 57: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Creating Calculated Field58

ตัวอย่างที่ใส่ชื่อฟิลด์ใหม่ซึ่งจะมาเป็นชื่อคอลัมน์และใส่สูตรแล้ว

Page 58: PivotTable · The ribbon for Pivot Tables 22 Q 2 แบอย Analyze บ Design NองQการคrกเsอกนeใน Pivot Table มาอนงจะแสดง riboon

Creating Calculated Field59

ผลลัพธ์ที่ได้ในรายงาน จะนำฟิลด์ที่คำนวณขึ้นมาใหม่มาแสดงเป็นผลรวม