This is part 2 of a 7 part series on how to decompose Spotfire projects. Last week, I started off with a post on data tables and connections. This week, I am covering how to decompose data functions. Data functions are quite frequently used to create data tables and can create a lot of complexity in a project. Thus, the series covers them early on.
Now, each post in the series will be broken down into four sections.
- Quick and Dirty (Q&D)
- The Extended Version
- Room for Improvement
The Q&D explains what to look for to get a general idea of what is going on. The Extended version works to develop an in-depth knowledge of the project. Each post will also include suggestions for documentation and improving the project.
Quick and Dirty
- What are the data functions doing? Are they creating new tables, new columns, or just transforming data?
- What’s going into and out of them? What are the input and output parameters?
- Do they work? It happens that someone attempts to write a data function and it doesn’t work out. Rather than delete it, they just leave it.
How: Go to Edit > Data Function properties and review the script, input parameters, and output parameters.
- Are the data functions using property controls, filtering schemes, or marking?
- Is any code commented out?
- Do the data functions use packages?
The screenshots below were taken from the documentation of two different projects. One of them I fully documented using a PowerPoint deck. The slides shown below summarize the usage of data functions. The last screenshot is Excel documentation to show which tables were an input or an output of a data function.
Now, here are a few suggestions for improving data functions in a project.
- Add commenting in the data function to improve ease of understanding, especially if it’s a long data function.
- Remove unused sections of code to clean up the data function.
- Combine data functions where possible. It’s very common for developers to build as they go, but that separate might make the project harder to understand. Consider combining data functions where applicable.
- Add descriptions in the data functions if they don’t have them. This will make them easier to understand 6 months from now.
All content created with Spotfire 7.12.
Well, that wraps up how to decompose data functions. Next week, we’ll look at how to understand table build and data wrangling.
Guest Spotfire blogger residing in Whitefish, MT. Working for SM Energy’s Advanced Analytics and Emerging Technology team!