By the end of this chapter you will be able to:
Table of Contents
You will also learn how to pass only some records to the receiving stream using the Maximum Number of Records per Group option.
In this exercise you will select the most recent sales record for each customer from the set of combined updates you created in the previous exercise.
...
- In the model, double-click on the pipe from the
Combined Updates
stream. - Expand the Sort/Group section toolbar.
- In the section toolbar, click
. Phixflow opens a list of the attributes that theInsert excerpt _stream_attributes _stream_attributes nopanel true Combined Updates
stream can pass to the pipe. - Drag in
CustomerRef
. By default, this attribute has Group ticked and Direction set to A-Z (ascending).
This means the data records will be grouped byCustomerRef
. - Drag in
SalesDate
. Double-click onSalesDate
in the Sort/Group grid. PhixFlow opens a the settings form for the attribute. In Basic Settings, set:- Direction: Z-A (descending)
- Group:
Insert excerpt _check_box_untick _check_box_untick nopanel true - Click
to save the change and close the attribute settings.Insert excerpt _finish _finish nopanel true
This means the data records will be sorted by date, with the most recent first.
- Direction: Z-A (descending)
- In the pipe settings → Sort/Group, set Maximum Number of Records per Group to 1.
This means PhixFlow will pass only one record, the first and therefore most recent, to the receiving stream. - Click
to save the pipe settings, which should look like this:Insert excerpt _save _save nopanel true - In the model toolbar, click
to save the model.Insert excerpt _save _save nopanel true
...