...
- Set up aggregate attributes on pipes
- Read aggregate attributes from pipes into a Streamstream
In this exercise you will create a report of total and average last billed amounts, aggregated by Region:
In your model, add a new
...
stream:
- Hover over
Customers in England
, and press press - Add a new Stream - Give the new Stream the Name:
Customer Summary by Region
- Double-click on the new pipe to open the details form
- Go to the tab Sort/Group section:
- Drag the Attribute Region from the left-hand box Open the list of attributes, and drag the attribute
Region
into the list of sorting/ grouping attributes
- Drag the Attribute Region from the left-hand box Open the list of attributes, and drag the attribute
- Go to the Aggregate Attributes tab section:
- Press Press to add a new aggregate attribute
- In the new aggregate attribute form:
- Set the Aggregate Stream Function to Count
- Leave the Attribute blank
- Set the New Attribute Name to
CountRecords
- Press Press
- Add another aggregate attribute: press
- Press - Show the list of Attributes
- Drag the attribute
BILLAMOUNT
into the aggregate attributes list - Note that this already uses the attribute function Sum – leave this as it is
- Update the name of the aggregate value:
- Double-click on the new aggregate attribute
- Update the
New Attribute - Name to
TotalLastBillAmount
Press - Name to
- Press
- Add another aggregate attribute: press
- Press - Show the list of Attributes
- Drag the attribute
BILLAMOUNT
into the aggregate attributes list - Update the details for this new aggregate attribute:
- Double-click on it
- Update the
Aggregate - Stream Function to Average
- Update the
New Attribute - Name to
AvgLastBillAmount
- Name to
Press - Press
Now you need to configure your output Stream:
- Drag the Attribute attribute
Region
from the Sort/Group tab section of the pipe onto the Stream streamCustomer Summary by Region
- Drag the aggregate attributes you added from the Aggregate Attributes tab section of the pipe onto the Stream stream
Customer Summary by Region
- In the main pipe configuration form, press press
Remember to save your model layout.
- Run Analysis analysis on
Customer Summary by Region
- Have a look at the data in this Stream stream – check that the aggregated report has been generated correctly