Exercise - Create New Fields

Now that you’ve learned how to define your schema and create new fields using field-building functions, let’s try some on your own

Exercise 1 - Add new field

In our first exercise, let's create a new field using our Field Build Functions.

Can you create a field that will hold the delta between the "offered_amount" and "approved_amount"?

  • Bonus - as this is a numeric field, can you also create a segmentation for this field?

In the next exercise we will create another field so wait with backfilling until all new fields are ready.

See Solution We start with clicking on “add field”. Now add a name - we will call this field “offered_approved_delta”. Under type, we will choose "numeric". Now under “function” we will choose the “delta” function and add the 2 sources - “offerd_amount” and “approved_amount”. When all is set we will click on "add field" to save it.

Exercise 2 - Use this field to create another field

Now that you created "offered_approved_delta", use this field to create another new field.
Can you create a normalized delta field for offered and approved amounts? Normalized in this case means divided by the offered amount.

See Solution Use the previous field to create another field. Click on “add field”. Now add a name - we will call this field “offered_approved_delta_normalized”. Again under type, we will choose "numeric", and under "function" we will choose "divide". Now in sources, we will add "offered_approved_delta" as the first source and "offered_amount" as the second. When all is set we will click on "add field" to save it.

To add segmentation for this field, under “segmentation” add a new segmentation, and now choose the type - either by "bucket size", by "number of buckets", as a "logarithmic scale", or "discrete". As this is a normalized field, the values range from 0 to 1, so 20 buckets of 0.5 in size would work well here.

📘

Backfill your data

Once both fields are created, you should now backfill the data in order for the new fields to be written in the data.


Did this page help you?