In this tutorial you will use the output of the denormalizing process from the previous chapter. You will calculate the age of the films and classify them according to their age.
Get the file with the films. You can take the transformation that denormalized the data and generate the file with a Text file output step, or you can take a sample file from the Packt website.
Create a new transformation and read the file with a Text file input step.
Do a preview of the data. You will see the following:
After the Text file input step, add a Get System Info step.
Edit the step, add a new field named
today
, and chooseToday 00:00:00
as its value.Add a JavaScript step.
Edit the step and type the following piece of code:
var diff; film_date = str2date('01/01/' + Year, 'dd/MM/yyyy'); diff = dateDiff(film_date,today,”y”);
Click on Get variables to add
diff
as a new field.Add a Number range step, edit it, and fill its window as follows:
With...