[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[[["\u003cp\u003eThis page details how to perform numeric calculations on data within the Wrangler workspace of Cloud Data Fusion Studio, across data types like Integer, Decimal, Double, Float, Long, and Short.\u003c/p\u003e\n"],["\u003cp\u003eNumeric functions can be applied to one or more columns, allowing users to either modify existing column values or create new columns with the calculated results.\u003c/p\u003e\n"],["\u003cp\u003eApplying a numeric function to a single column involves specifying a decimal value for the calculation, while applying the same function to multiple columns will perform the calculation row by row, between the columns.\u003c/p\u003e\n"],["\u003cp\u003eWrangler provides a variety of numeric functions, including arithmetic operations (Add, Subtract, Multiply, Divide), trigonometric functions (Sin, Cos, Tan), logarithmic functions, and statistical calculations (Average, Max, Min), for use on single or multiple columns.\u003c/p\u003e\n"],["\u003cp\u003eCloud Data Fusion, version 6.8.0 and later, supports performing calculations on three or more columns simultaneously, allowing for a combination of calculations such as adding values from several columns into a new single column.\u003c/p\u003e\n"]]],[],null,["# Work with numbers\n\nThis page explains how to perform numeric calculations when you prepare data in\nthe Wrangler workspace of the Cloud Data Fusion Studio.\n\nYou can perform these transformations in columns of the following data types:\n\n- Integer\n- Decimal\n- Double\n- Float\n- Long\n- Short\n\n| **Note:** To use numeric functions on decimal columns, use the [Wrangler CLI](/data-fusion/docs/concepts/wrangler-overview#wrangler-cli).\n\nFor more information, see the [`set-column`](https://cdap.atlassian.net/wiki/spaces/DOCS/pages/382107931) directive.\n\nYou can use numeric functions on one or more columns. The available numeric\nfunctions vary by the number of columns you select. You can choose to create a\nnew column with the results of the calculations, or you can have the results\nappear in the column where you add the transformation.\n\nIf you apply a numeric\nfunction to a single column, the behavior is different than if you apply a\nnumeric function to multiple columns. For example:\n\n- If you use the `Multiply()` function on *a single column*, you specify the decimal value to multiply each value in the column by. Wrangler performs the multiplication on the sample data and displays the new values in the same column or in a new column.\n- If you use the `Multiply()` function on *multiple columns*, Wrangler multiplies the values in each row for the selected columns and displays the new values in the first column of the transformation.\n\nPerform numeric calculations on values in one column\n----------------------------------------------------\n\nTo apply a numeric calculation to one column, follow these steps:\n\n1. [Go to the Wrangler workspace in Cloud Data Fusion](/data-fusion/docs/concepts/wrangler-overview#navigate-to-wrangler).\n2. On the **Data** tab, go to a column name and click the arrow_drop_down expander arrow.\n3. Select **Calculate** and select an option---for example, **Add**.\n\n To complete the calculation, some functions require you to enter a decimal\n value. For example, if you select **Subtract**, you must enter the value to\n subtract from each row.\n4. Optional: to create a new column for the calculated values, select the\n **Copy to a new column** checkbox.\n\n5. Click **Apply**.\n\nThe values change based on the calculation. Wrangler adds the corresponding\ndirective as a step in the recipe. For example, if you subtract two from each\nvalue in the `Price` column, Wrangler adds the following transformation to the\nrecipe: \n\n set-column :Price Price - 2\n\nWhen you run the data pipeline, the transformation is applied to all values in\nthe column.\n\n### Supported calculations for one column\n\nYou can perform the following calculations on all values in one column:\n\nPerform numeric calculations on values in two columns\n-----------------------------------------------------\n\nTo apply a numeric calculation to two columns, follow these steps:\n\n1. [Go to the Wrangler workspace in Cloud Data Fusion](/data-fusion/docs/concepts/wrangler-overview#navigate-to-wrangler).\n2. On the **Data** tab, select the checkbox by two column names.\n3. Go to a column name and click the arrow_drop_down expander arrow.\n4. Select **Calculate** and select an option---for example, **Add**.\n5. Optional: to create a new column for the calculated values, select the **Copy to a new column** checkbox. Otherwise, the calculated values override existing values.\n6. Click **Apply**.\n\nThe values change based on the calculation. Wrangler adds the corresponding\ndirective as a step in the recipe. For example, if you add the values in each row\nof the `Q1_Sales` and `Q2_Sales` columns and create a new column called\n`H1_Sales`, Wrangler adds the following transformation to the recipe: \n\n set-column :H1_Sales arithmetic:add(Q1_Sales, Q2_Sales)\n\nWhen you run the data pipeline, Wrangler performs the transformation and creates\na new column called `H1_Sales` with the total of `Q1_Sales` and `Q2_Sales`.\n\n### Supported calculations in two columns\n\nYou can perform the following numeric calculations on values in each row in two\ncolumns:\n\nPerform numeric calculations on values in three or more columns\n---------------------------------------------------------------\n\nCloud Data Fusion supports performing numeric calculations on values in\nthree or more columns in version 6.8.0 and later.\n\nTo apply a numeric calculation to three or more columns, follow these steps:\n\n1. [Go to the Wrangler workspace in Cloud Data Fusion](/data-fusion/docs/concepts/wrangler-overview#navigate-to-wrangler).\n2. On the **Data** tab, select the checkbox by two column names.\n3. Go to a column name and click the arrow_drop_down expander arrow.\n4. Select **Calculate** and select an option---for example, **Add**.\n5. Optional: to create a new column for the calculated values, select the **Copy to a new column** checkbox. Otherwise, the calculated values override existing values.\n6. Click **Apply**.\n\nThe values change based on the calculation. Wrangler adds the corresponding\ndirective as a step in the recipe. For example, if you add the values in each row\nof the `Q1_Sales`, `Q2_Sales`, `Q3_Sales`, and `Q4_Sales` columns and create a\nnew column called `2022_Sales`, Wrangler adds the following transformation to\nthe recipe: \n\n set-column :2022_Sales arithmetic:add(Q1_Sales, Q2_Sales, Q3_Sales, Q4_Sales)\n\nWhen you run the data pipeline, Wrangler performs the transformation and creates\na new column called `2022_Sales` with the total of `Q1_Sales`, `Q2_Sales`,\n`Q3_Sales`, and `Q4_Sales`.\n\n### Supported calculations in three or more columns\n\nYou can perform the following calculations on values in each row in three or\nmore columns:\n\nWhat's next\n-----------\n\n- Learn more about [Wrangler directives](/data-fusion/docs/concepts/wrangler-overview#apply_directives)."]]