---
schema_version: "1"
id: faa29820fb30d2f64b58d7fcf95b333b7f7327836719d82498c06986d8fdd56b
title: สร้างฟิลด์ที่คำนวณง่ายๆ
collection: tableau
version: current
locale: th-th
portal_url: https://docs.salesforce.com/tableau/current/th-th/pro/desktop/calculations_calculatedfields_formulas.md
canonical_url: https://help.tableau.com/current/pro/desktop/th-th/calculations_calculatedfields_formulas.htm
source_site: help.tableau.com
content_type: documentation
content_hash: 7855f137d1923edf106c3b3f0607697ef80920b7ec707506afd0b5f98fb42b6f
description: Create a simple calculated field, such as Profit Ratio, using a formula from existing fields.
---
[ข้ามไปยังเนื้อหาหลัก](#main-content)

# สร้างฟิลด์ที่คำนวณง่ายๆ

บางครั้งแหล่งข้อมูลก็ไม่มีฟิลด์ (หรือคอลัมน์) ที่คุณต้องการสำหรับการวิเคราะห์ ตัวอย่างเช่น แหล่งข้อมูลอาจมีฟิลด์ที่มีค่าสำหรับยอดขายและกำไร แต่ไม่ใช่ค่าสำหรับอัตราส่วนกำไร หากเป็นเช่นนี้ คุณสามารถสร้างฟิลด์ที่คำนวณสำหรับอัตราส่วนกำไรได้โดยใช้ข้อมูลจากยอดขายและกำไร

หัวข้อนี้จะแสดงวิธีสร้างฟิลด์ที่คำนวณง่ายๆ โดยใช้ตัวอย่าง

## ขั้นตอนที่ 1: สร้างฟิลด์ที่คำนวณ

1. ในเวิร์กชีตใน Tableau ให้เลือกการวิเคราะห์ > สร้างฟิลด์ที่คำนวณ
2. ในตัวแก้ไขการคำนวณที่เปิดอยู่ ให้ตั้งชื่อฟิลด์ที่คำนวณ ในตัวอย่างนี้ ฟิลด์ที่คำนวณจะเรียกว่า**อัตราส่วนกำไร**

## ขั้นตอนที่ 2: ป้อนสูตร

1. ในตัวแก้ไขการคำนวณ ให้ป้อนสูตรต่อไปนี้:
    
    SUM(\[Profit\])/SUM(\[Sales\])
    
    สูตรใช้ฟังก์ชัน ฟิลด์ และโอเปอเรเตอร์ร่วมกัน หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับการสร้างสูตรใน Tableau โปรดดู[การเขียนการคำนวณใน Tableau](https://help.tableau.com/current/pro/desktop/th-th/functions_operators.htm) และ[ฟังก์ชันใน Tableau](https://help.tableau.com/current/pro/desktop/th-th/functions.htm)
2. เมื่อเสร็จแล้ว ให้คลิก**ตกลง** ฟิลด์ที่คำนวณใหม่จะได้รับการเพิ่มลงในแผงข้อมูลโดยมีเครื่องหมาย = ด้านหน้าไอคอนประเภทข้อมูลเพื่อระบุว่าเป็นฟิลด์ที่คำนวณ

ตอนนี้คุณพร้อมที่จะใช้ฟิลด์ที่คำนวณในมุมมองแล้ว

## ตรวจสอบงานของคุณ! ดูวิธีสร้างฟิลด์ที่คำนวณง่ายๆ ที่ดำเนินการอยู่

## ดูเพิ่มเติม

[เริ่มต้นการคำนวณใน Tableau](https://help.tableau.com/current/pro/desktop/th-th/calculations_calculatedfields_create.htm)

[การเขียนการคำนวณใน Tableau](https://help.tableau.com/current/pro/desktop/th-th/functions_operators.htm)

[ฟังก์ชันใน Tableau](https://help.tableau.com/current/pro/desktop/th-th/functions.htm)

[สร้างนิพจน์ระดับรายละเอียดใน Tableau](https://help.tableau.com/current/pro/desktop/th-th/calculations_calculatedfields_lod.htm)

[เปลี่ยนค่าต่างๆ ด้วยการคำนวณตาราง](https://help.tableau.com/current/pro/desktop/th-th/calculations_tablecalculations.htm)