...
- Use the attribute function replaceAll()
- Use the attribute function toUpper()
- Use the attribute function substring()
- Use the attribute function if()
- Use the internal variable _out
Anchor | ||||
---|---|---|---|---|
|
You will reformat post codes to remove all spaces, and ensure that all letters are upper case:
...
In the left-hand menu bar press - Show the List of Attribute Functions. All attribute functions available in PhixFlow are shown. Find the attribute functions you used above – toUpper() and replaceAll() – and double-click each of these to see the help pages for these functions.
Anchor | ||||
---|---|---|---|---|
|
Now you will generate a short code for counties by taking the first 3 letters of the county for each customer detail record:
...
- Your attribute expression should now say: substring(_out.in_County, 1, 3)
- Press
Anchor | ||||
---|---|---|---|---|
|
Categorise bills as "LARGE" or "NORMAL":
...
- Your attribute expression should now say: if (_out.BILLAMOUNT > 10.0, "LARGE", "NORMAL")
- Press
Anchor | ||||
---|---|---|---|---|
|
Finally, you will now set a special processing flag – this will be set to "Yes" when the last bill for the customer is large. To do this, we need to access an attribute value in the Stream, but which is not in any of the input pipes to the Stream - only in the Stream output. To do this, you will use the internal variable _out:
...
- Your attribute expression should now say: if (_out.BillCategory == "LARGE", "YES", "NO")
- Press
Anchor | ||||
---|---|---|---|---|
|
- In the main stream configuration form, press
- Remember to save your model layout.
- Run Analysis on Reformatted Customer Details
- Have a look at the data in the new Stream – check that all your transformations have been correctly applied