A user has the following two columns of different datatypes:
- Column of type 'datetime'
- Column of type 'Integer'
The user wants to create a metric that adds days (integer metric) to a particular date (datetime metric). The expected result is shown in the table below:
x Column 1 (datetime)Column 2 (Integer)Result12/01/2006312/04/200604/15/20041004/25/2004 | x Column 1 (datetime)Column 2 (Integer)Result12/01/2006312/04/200604/15/20041004/25/2004 | x Column 1 (datetime)Column 2 (Integer)Result12/01/2006312/04/200604/15/20041004/25/2004 |
x Column 1 (datetime)Column 2 (Integer)Result12/01/2006312/04/200604/15/20041004/25/2004 | x Column 1 (datetime)Column 2 (Integer)Result12/01/2006312/04/200604/15/20041004/25/2004 | x Column 1 (datetime)Column 2 (Integer)Result12/01/2006312/04/200604/15/20041004/25/2004 |
x Column 1 (datetime)Column 2 (Integer)Result12/01/2006312/04/200604/15/20041004/25/2004 | x Column 1 (datetime)Column 2 (Integer)Result12/01/2006312/04/200604/15/20041004/25/2004 | x Column 1 (datetime)Column 2 (Integer)Result12/01/2006312/04/200604/15/20041004/25/2004 |
In order to successfully apply the metric function to combine the result of a datetime column with an integer column, follow the steps below using the Strategy Tutorial project:
- Create a metric called 'metric1' using the attribute 'Ship Date.' This attribute is of type datetime. In this example, a Max function is applied to the metric, as shown below. Based on the purpose of the metric, a related function can be applied to the metric.