蜜豆视频

Add an Enumeration type calculated field adding-an-enumeration-type-calculated-field

Here we want to create a query with an Enumerations type calculated field. This field will generate an additional column in the data preview window. This column will specify the numeric values returned as a result for each recipient (0, 1 and 2). A gender will be assigned to each value in the new column: 鈥淢ale鈥 for 鈥1鈥, 鈥淔emale鈥 for 鈥2鈥 or 鈥淣ot indicated鈥 if the value equals 鈥0鈥.

  • Which table needs to be selected?

    The recipient table (nms:recipient)

  • Fields to be selected in the output column?

    Last name, First name, Gender

  • Criteria which the information will be filtered based on?

    The rrecipient language

Apply the following steps:

  1. Open the Generic query editor and select the Recipient table (nms:recipient).

  2. In the Data to extract window, select Last name, First name and Gender.

  3. In the Sorting window, click Next: no sort is necessary for this example.

  4. In Data filtering, select Filtering conditions.

  5. In the Target element window, set a filter condition to collect recipients who speak English.

  6. In the Data formatting window, click Add a calculated field.

  7. Go to the Type window of the Export calculated field definition window and select Enumerations.

    Define the column which the new calculated field must refer to. To do this, select the Gender column in the drop-down menu of the Source column field: the destination values will coincide with the Gender column.

    Define the Source and Destination values: the destination value makes the query result easier to read. This query should return recipient gender and the result will either be 0, 1, or 2.

    For each 鈥渟ource-destination鈥 line to be entered, click Add in the List of enumeration values:

    • In the Source column, enter the source value for each gender (0,1,2) in a new line.
    • In the Destination column, enter the values: 鈥淣ot indicated鈥 for line 鈥0鈥, 鈥淢ale鈥 for line 鈥1鈥, and 鈥淔emale鈥 for line 鈥2鈥.

    Select the Keep the source value function.

    Click OK to approve the calculated field.

  8. In the Data formatting window, click Next.

  9. In the preview window, start the preview of the data.

    The additional column defines the gender of 0, 1 and 2:

    • 0 for 鈥淣ot indicated鈥
    • 1 for 鈥淢ale鈥
    • 2 for 鈥淔emale鈥

    For example, if you don鈥檛 enter gender 鈥2鈥 in the List of enumeration values, and the Generate a warning and continue function of the In other cases field is selected, you will get a warning log. This log indicates that gender 鈥2鈥 (Female) has not been entered. It is displayed in the Logs generated during export field of the data preview window.

    Let鈥檚 take another example and say that enumeration value 鈥2鈥 isn鈥檛 entered. Select the Generate an error and reject the line function: all gender 鈥2鈥 recipients will raise anomalies and the other information in the line (first and last name, etc.) will not be exported. An error log is displayed in the Logs generated during export field of the data preview window. This log indicates that enumeration value 鈥2鈥 isn鈥檛 entered.

recommendation-more-help
601d79c3-e613-4db3-889a-ae959cd9e3e1