官术网_书友最值得收藏!

Creating calculated fields

Calculated fields are new fields that exist only in the Qlik Sense data model. They are derived from the data that has been loaded.

Using the Data manager, you can edit your table and add another field, which means you can derive more information about your data by editing the table structure. To add these fields, do the following:

  1. Go to the Data section and select your Orders table. After doing this, select the small pencil that signifies the edit button at the bottom:
  1. The following screen then appears: 

Let's discuss some options (please refer to Further reading section for a link to the entire documentation on table editing).

For each selected field, you can do the following:

  • Replace values: By using this option, you can change values into new values, and fix data quality issues, like mistypes values. An example of this is shown in the following screenshot:
  • Set nulls: By using this option, you can change values into nulls, which means the null values will not be shown on Qlik Sense. As we can see in the following screenshot, 10249 and 10248 will be replaced with null values:

As we can see in the following screenshot, we have some options for each field:

We have the following options:

  • Rename: As the name states, this merely allows you to rename the field
  • Associate: This allows you to associate this table with another table (we will focus on this later in this chapter, in the Table associations section)
  • Sort: This option helps sort the field values based on values from that field
  • Hide in Analysis: If this option is used, this field will not be displayed in Qlik Sense
  • View details: This is a shortcut to a screen that shows if this field is calculated or not

All of these options are related to existing fields, but we can create calculated fields using the Add field button that lies on the upper-right side of the screen. To do this, follow these steps: 

  1. Press Add field and then select Calculated field:
  1. A popup containing a form will appear, as follows: 
  1. Create a field called Processing Time that calculates the gap between the OrderDate and ShippedDate using a function called Interval that formats the gap time:
  1. To consolidate our new field, please press Load data on the upper-right of the screen. Our application will be refreshed and the field will be created in the data model:

Now, we have created a field that can be used in our application like any other that came from our original data file.

主站蜘蛛池模板: 柏乡县| 江华| 策勒县| 石门县| 乌海市| 丽水市| 濮阳县| 县级市| 岳普湖县| 芦溪县| 通辽市| 定兴县| 高淳县| 东山县| 应城市| 湖北省| 新宁县| 湘乡市| 连云港市| 锡林郭勒盟| 淮北市| 家居| 久治县| 云安县| 武川县| 景谷| 株洲县| 鸡泽县| 萍乡市| 仁布县| 长葛市| 福泉市| 五原县| 遂川县| 锦屏县| 安远县| 通海县| 东辽县| 黄梅县| 安仁县| 西丰县|