/
15 Creating and using macros
PhixFlow Help
15 Creating and using macros
By the end of this chapter you will be able to:
- Create macros
- Use macros
Creating macros
- Create a macro:
- Find - Macros in the repository
- Right click and select Add Macro
- Configure the macro:
- Name:
NumOfWeeks
- Minimum Parameters:
2
- Maximum Parameters:
2
- Expression: create an expression to work out the number of weeks - as a whole number – between two dates
- Use the functions dateDiff() and round() to help with this
- Name:
- Press to save your new macro
Using Macros
- Create a new model:
Try Macros
- Drag the stream
MC Macro Terminated Customers
on to your model
This contains some key dates for terminated customers: the signup date; the date that the customer terminated their service; the date that the final debt on the customer's account was cleared
- Add attributes for:
- the number of weeks between signup and termination
- the number of weeks between termination and the final debt being cleared
- In each case, use your macro to calculate the number of weeks between the two dates
- Run the stream
MC Macro Terminated Customers
to test your new attributes
Related content
14 Attribute scripting
14 Attribute scripting
Read with this
22 Creating and using macros
22 Creating and using macros
More like this
dateDiff
dateDiff
Read with this
Creating and using macros
Creating and using macros
More like this
Introduction
Introduction
Read with this
15 Creating and using macros
15 Creating and using macros
More like this
Please let us know if we could improve this page feedback@phixflow.com