Anonymizing data, nowadays is a “must’ in every organization. Having trouble with anonymizing a column in Spotfire? Then read this step-by-step manual. Consider the following situation; you have one table coming from a database (it doesn’t matter what type). This table contains production information about people.
To make it simple:
In Spotfire you want to report about the production but you cannot report about the people, so you want to categorize them into departments. These departments are not in the database yet, but in this case we have a spreadsheet:
The only proper way to join these tables is to put them into Spotfire and join on Name. However, the customer explicitly tells us that the Names should not be recognizable, as this might be a breach of privacy.
So, I started to look for a way to scramble the Name in both tables in such a way they can no longer be recognized but can still be used to join on. I decided to turn to Steven van der Kroft at TIBCO and we jointly came to a workable solution. Thanks, Steven, for your help!
How to anonymize data in Spotfire
So, what did we do? Steven created a small R script for me that did exactly what I was looking for:
df <- data.table(Tbl)
df$Name <- hash_names(df$Name,size = 25, full = FALSE)
(If you want to run this with live data on a web player then this does require a Statistical Server, obviously)
In the Input Parameters define Tbl as a Table, and in the Output Parameters define df as a Table. In this example, “Name” is hard coded, and is exactly the name of the column.
When adding a data table you can add this script as a Transformation. The result for the first table would look something like this:
And for the second:
As you can see, the names cannot be recognized anymore, but we can still use them to join on! Just make sure you do not run the script twice…
Devoteam’s Spotfire knowledge
If you’re interested in setting up or improving your Spotfire you might be interested in the following blogs as well.
- Blog: Spotfire 7.11 is here!
- Blog: How to use properties in your Spotfire visualizations
- Blog: How to make a Spotfire Accordion in 3 easy steps!
Get in touch!
For more information about Tibco Spotfire, feel free to contact Eric Hans van Wingerden (firstname.lastname@example.org), Senior Spotfire Consultant at Devoteam Netherlands.
Or check out our Spotfire Knowledge below.
More about our TIBCO Spotfire Knowledge
Want to learn more about Spotfire through our client use cases, handy how-to articles and blog-posts? Click the button below to discover our knowledge.