[Random DataSources] Customized Quarter

This recipe demonstrates how to display quarter based upon random dates.
Steps taken:

Create a random datasource (Random Dates.ds). In the “Define Random Datasource” page, add the following column:

Column Name=Date, Data Type=Date, Value Type=Expression, Range from 2004-01-01 to 2008-12-31

Create a composite datasource (Quarters.ds). Drag the random datasource into it as the beginning of the flow.

Add a Sort element following the random datasource. Add the following column into the “Sort” page:

Column Name=Date, Sort Order=Ascending, Group On=Quarter, Field=Q

Add a Derivative element following the Sort element. Add the following columns into the “Derivative > Base” page:

Column 1 Name=Date, Type=Date
Column 2 Name=Q, Type=Integer

Add the following column into the “Derivative > Derived” page:

Column 1 Name=Q, Type=String, Value=“Q”+(Q==0 ? 4 : Q)

Add a Sort element following the Derivative element. Add the following column into the “Sort” page:

Column Name=Q, Sort Order=Ascending, Group On=None

Upon loading data, it will display the random dates and relevant quarter information.

To download the necessary files for this recipe, refer to the attached ZIP file.
CustomizedQuarter.zip